Chart in excel sheet

Hiii,
I want draw the chart in the excel sheet without using report generation tool kit . i have the sensor data w.r.t. time in the excel sheeet as shown below
Time
Temperature
4/12/2007 1:55 PM
153
4/12/2007 1:55 PM
152
4/12/2007 1:55 PM
151
4/12/2007 1:55 PM
150
4/12/2007 1:55 PM
149
4/12/2007 1:55 PM
148
4/12/2007 1:55 PM
147
4/12/2007 1:55 PM
126
4/12/2007 1:55 PM
127
4/12/2007 1:55 PM
128
4/12/2007 1:55 PM
129
4/12/2007 1:55 PM
130
i have tried some of the example given in the discussion forum but its not giving the right range
Rgrds
HKT

thks to all for the valueable comments
let me explain my application more, to clear the concept of using excel in this particular application
I am storing the data(time/temp) in the binary format on the hard disk.
the excel part comes when user want to have the excel report for its analysis .
that is user can use the data but soring it in the excel (format i have shown) as well as chart ( for better visualization)
the first part(insert data into excel sheet)  i have made using activex control but in the scond part( insert chart into excelsheet) when i give the range specifed in the excelsheet it give me the error 3008
it is better to make chart by using 2D array of string but i am unable to find the result for the same
VI is attached with this reply
Attachments:
Test Vi Chart.vi ‏52 KB

Similar Messages

  • Making different graphs like bar chart in excel sheet

    Hello,
    In my application i have to make different graphs like bar chart,pie chart etc which is present in the excel sheet.In the same excel sheet i have to make the graphs based on the data through java program.
    I am unable to do it.Can anyone suggest me how to do.Is there any api and documents(for reading )for it?
    thanks in advance
    chimpuk

    Hi, you might want to do a search before you post. At the top of the page is a link to advanced search. Right-click on it and choose 'open in a new window'. Now, in the 'with all the words' box type the word excel, then hit the space bar, then type the word chart[b], now down lower clear all the checkboxes except [b]Java Forums, now hit the Search button and you get a list of threads related to excel and chart. Read a few. I think most of your questions will be answered.

  • (Bug?) Adding an excel chart into a sheet

    Has anybody experienced the following problem?
    I've built a chart in excel, and everything is ok, but when i try to put it into a sheet, something fails. There's no error reported, but the Location property of Chart class fails, and my chart appears as an independent sheet. This works fine under Visual Basic, so i thought it could be some problem with LabVIEW.
    I'm using LV 5.0.1f1 and Excel 2000.
    Thanks in advance

    Well, I have a Labview 6i, but I don't know how put into charts in the same sheets?. Can you help me? I only put one chart in a new sheet. I send you my file, you can modified it to do that I want.
    Attachments:
    CreateChart_inSheet.vi ‏60 KB

  • Access excel sheet uploaded in library on sharepoint using sharepoint development

    Hi,
    I have an excel sheet which i have uploaded on sharepoint site as a library.
    now i want to access this excel sheet using sharepoint development(c#).
    Is it possible?
    I have one another query- I want to read excel sheet using sharepoint 2010 development.
    Please help to solve both issues.
    Thanks in advance!
    Regards
    rajni

    Hi rajni,
    According to your description, my understanding is that you want to access the excel files uploaded in a library and read the worksheet data by C#.
    You can read excel file using Excel Services. The Excel Services REST API is a new feature of Excel Services that enables you to access Microsoft Excel workbook data by using a uniform resource locator (URL) address. Using the REST API, you can retrieve
    resources such as ranges, charts, tables, and PivotTables from workbooks stored on SharePoint Server 2010. More inforamtion, please refer to the link below:
    http://msdn.microsoft.com/en-us/library/hh124646(v=office.14).aspx
    There are other useful links about accessing and reading excel file in library, please take a look at:
    http://www.sharepointwithattitude.com/archives/61
    http://www.c-sharpcorner.com/uploadfile/vivekbritish/how-to-downloadread-excel-file-from-sharepoint-library-using-excel-services/
    http://stackoverflow.com/questions/14496608/read-excel-file-stored-in-sharepoint-document-library
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • How can I make an Excel Sheet where I can tally my daily activities and make a graph of it?

    I want a simple excel sheet where in the columns I can have dates and in the rows I can have my activities and in the spaces between I can put a number like 1 or 2 or 5 indicating the number of hours spent that day on that activity.  Finally, I would
    want to be able to, using the hours data for the entire month for each activity, be able to create a pie chart breaking down how much time I spent on each activity.
    The issue is I do not know to rename rows and columns and I do not know how to format it all to ensure I can make a pie chart at the end comparing all of my activities.  
    Any help would be appreciated.  

    Hi,
    Do you mind sharing us a sample file here? It'll help us understand your request more cleanly.
    Regards,
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How can I download to one excel sheet from more than two table?

    Hi.
    as you know
    <SAP_BW_URL CMD='EXPORT' FORMAT='XLS' DATA_PROVIDER='DATAPROVIDER_T1' >
    this script can make download excel sheet which is same cotents of table or chart in web template.
    but if template has more than two tables how can we get excel sheet from tables?
    <SAP_BW_URL CMD='EXPORT' FORMAT='XLS' DATA_PROVIDER_1='DATAPROVIDER_T1' DATA_PROVIDER_2='DATAPROVIDER_T2'>
    I hope this gonna work but result was fail same as I expected.
    is there any way put two tables download one excel sheet?

    Welcome to SDN.
    Post this in Business Explorer forum for quicker resposne.
    SAP Business Explorer (SAP BEx)
    Regards
    Raja

  • Colored Cells in Excel sheet

    hi
    we have a excel sheet with values which we created based on a tutorial spreadsheet. We tried the exactly the same steps provided in the PDF but it did not work. however when we used the original file we got the same output that was shown in the PDF screenshot. Here is what we tried.
    we created a spreadsheet similar to the one given below
    City     JAN     FEB     MAR     APR     MAY     JUN     JUL     AUG     SEP     OCT     NOV     DEC     Low     High
    ABILENE, TX     44     49     56     65     73     80     84     83     76     66     54     45     44     84
    AMARILLO, TX     36     41     48     56     65     74     78     76     69     58     45     37     36     78
    AUSTIN/BERGSTROM, TX     48     53     60     67     75     80     83     82     78     69     58     50     48     83
    In the canvas we placed a spreadsheet table control which contained the city names , a line chart and 2 gauges for HIGH and LOW values.
    Now the problem we faced was when we click on the city name in the table control nothing changed in the chart even though it was mapped to the correct cells.
    In the original file that came with the PDF there were YELLOW and RED blank cells to which it asked to map but those cells didnot contain any hidden data also. We would like to know is there any significance of those colored cells. whenever we download some sample excel file from the internet for a dashboard creation it has some colored cells, we would like to know does those cells contain any hidden info to make the dashboard work.
    Thanks
    GURU

    Most of the times, colored cells are used by the dashboard's designer to represent cells that are used at run time as origin/destination cells. This means that although at design time they are empty (they indeed are - there is no "hidden" data there), they contain data when the dashboard is executed.
    Some suggestions:
    - Check the component's properties to see which cells it uses.
    - Also, when in Preview, go to File -> Snapshot -> Current Excel Data to see what the Excel file actually looks like at run time. There you should see data in the colored cells.
    HTH,
    JK

  • Generate the Chart in Excel from Java

    Hi All,
    I have a typical problem that is I want to generate the
    Excel charts through Java coding dynamically . Now Iam able to
    create a excel sheet and populating the Data in that,but Iam not
    able and not even have the Idea how to generate the Chart with
    the popuated data , please can any body suggest me ...with the
    code snippet ( iam using the jxl 2.4.2 jar ) .
    Thanks in Advance

    Still Looking forward for the reply...Pls Help meGod, what a loser, to wait for 7 days for what I could find in less that 7 minutes on Google. And I'd never even heard of jxl.jar.
    Incidentally -- what do you think this has to do with Swing, that you posted it here in the Swing forum?
    db

  • Web Analysis - Exporting Chart to Excel

    Hello
    When I try to export a Chart from Web Analysis to MS Excel using Fully Formated option, it doesnot export the chart as it is. It converts it into spreadsheet and I can only see spreadsheet in the excel sheet. Is it how the export to excel suppose to work?
    I want the graph in the excel sheet.
    Regards
    Abhi

    Hi Mehmet,
    Firstly, thanks for taking the time out to reply.
    I followed the steps given in the link you posted.
    When I edit permission for the folder containing the reports, it does not reflect in Web Analysis in any way.
    For example: I assigned 'No Access' to a user to the entire folder, but yet the user is able to see the folder and the reports contained in it.
    Kindly help me with this.
    As for the 2nd issue, it has been sorted out and I can now export to Excel successfully :)
    Cheers,
    Sahil

  • Possible to Import a Chart from Excel?

    I beleive you can import a chart to XCelsius from Excel but can you do so to Crystal Reports?
    This would solve my current chart problems.

    Hi Philky,
    Try the following to insert charts into your CR.
    Go in Insertu2014OLE Objectu2014and select Microsoft Excel 97-2003 Wookbooku2014It will open a excel sheet.  You can open your chart and insert as OLE Object.
    Or
    You create a chart in excel and copy the chart and past in your Crystal Report.  If you double click on your chart it will take you to excel sheet again.
    Thanks,
    Sastry

  • Xcelcius using updated excel sheets?

    Hello,
    My excel sheet looks something like this
    A1         A2         A3        A4         A5
    10          20         30      <null>     <null>
    I have created a column chart using the values from A1 to A5, and supressing null values using the properties of the chart. And i have exported this as a flash file. Now the flash file displays 3 bars in the column chart, as expected.
    My requirement is that when the values A4 and A5 are updated in the excel sheet, I want the flash file column chart also to display these values immediately without having to re-create the column chart in xcelcius.
    Is this possible? If so, could you pls provide some pointers?
    Regards,
    Suraj.

    Hello Suraj,
    If I understand it correctly, you just have to import the new excel-file in Xcelsius, than the column-chart takes the new values in A4 and A5 automatically. And now you have to create a new flash-file.
    Precondition: you have selected A1 until A5 in the column-chart and you have selected "Ignore blank cells" in "Behaviour" of column chart.
    Hope, it helps
    Regards, Larissa

  • Missing X-Axis labels in exported excel sheet

    Created chart in Desktop Intelligence.
    Missing X-Axis labels in exported excel sheet.
    Please help me on thsi

    Use the Metrics Inspector.
    Click on the chart to select it, then click on one labels of the labels to select only the text box containing the x axis labels.
    In the Metrics Inspector, use the control or type in a value (in degrees CCW from horizontal) to Rotate the labels.
    You may also need to move, or remove the Legend showing the colour(s) used for each series. This is also in a Text box.
    Regards,
    Barry

  • Graph to be displayed in Excel Sheet

    Hi,
    The requirement is : We need to display a Line-Graph in the Excel Sheet.
    I referred the [sdn |Excel Charts in ABAP;:
    But, the Demo Programs SAPRDEMOEXCELINTEGRATION & SAPRDEMOEXCELINTEGRATION2 display a Default Graph and not with our Values.
    Can anyone suggest me how to achieve this? Custom Graph (for example from our own Internal Table Values) to be displayed in Excel Sheet.
    Thanks in advance.
    Thanks & Regards,
    Sowmya

    Hi,
    Can you please try using the following code
    CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
    *Sheet1
    CALL METHOD OF h_excel 'Workbooks' = h_mapl.
    SET PROPERTY OF h_excel 'Visible' = 1.
    CALL METHOD OF h_mapl 'Add' = h_map.
    gets the current worksheet
    GET PROPERTY OF h_excel 'activesheet' = worksheet.
    sets the name of the worksheet
    SET PROPERTY OF worksheet 'Name' = 'sheetnew'.
    pass data to sheet
    CALL METHOD OF worksheet 'Cells' = gs_cell1
    EXPORTING
    #1 = 1 " starting row of selection
    #2 = 1. " starting column of selection
    CALL METHOD OF worksheet 'Cells' = gs_cell2
    EXPORTING
    #1 = 1 " ending row of selection
    #2 = 1. " ending column of selection
    CALL METHOD OF worksheet 'Range' = range
    EXPORTING
    #1 = gs_cell1
    #2 = gs_cell2.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>CLIPBOARD_EXPORT
    IMPORTING
    DATA = GT_OUTPUT[]
    CHANGING
    RC = L_RC.
    CALL METHOD OF RANGE 'Select'.
    CALL METHOD OF WORKSHEET 'Paste'.
    create a chart sheet
    CALL METHOD OF h_excel 'charts' = h_chart.
    add a chart of variable h_chart1
    opens the initially created sheet
    CALL METHOD OF worksheet 'Select'.
    CALL METHOD OF h_excel 'Cells' = gs_cell1
    EXPORTING
    #1 = 1 " starting row of selection
    #2 = 1. " starting column of selection
    CALL METHOD OF h_excel 'Cells' = gs_cell2
    EXPORTING
    #1 = 4 " ending row of selection
    #2 = 2. " ending column of selection
    combine cells to form the range
    CALL METHOD OF h_excel 'Range' = range
    EXPORTING
    #1 = gs_cell1
    #2 = gs_cell2.
    sets the chart type
    CALL METHOD OF h_excel 'charts' = h_chart2.
    call method of h_chart2 'add' = h_chart3.
    SET PROPERTY OF h_chart3 'charttype' = '69'.
    title for chart
    SET PROPERTY OF h_chart3 'HasTitle' = 1.
    GET PROPERTY OF h_chart3 'ChartTitle' = ch_title.
    GET PROPERTY OF ch_title 'Characters' = ch_title.
    SET PROPERTY OF ch_title 'text' = 'inventory comparison'.
    CALL METHOD OF h_chart3 'SetSourceData'
    EXPORTING #1 = range " range to be passed to the chart
    #2 = 2. " selcts row/column
    CALL METHOD OF h_chart3 'ApplyDataLabels'
    exporting
    #1 = '5'.
    selects worksheet
    CALL METHOD OF worksheet 'Select'.
    CALL METHOD OF h_excel 'Cells' = gs_cell1
    EXPORTING
    #1 = 1 " starting row of selection
    #2 = 1. " starting column of selection
    CALL METHOD OF h_excel 'Cells' = gs_cell2
    EXPORTING
    #1 = 1 " ending row of selection
    #2 = 2. " ending column of selection
    CALL METHOD OF h_excel 'Range' = range
    EXPORTING
    #1 = gs_cell1
    #2 = gs_cell2.
    sets the bold for the header
    GET PROPERTY OF range 'Font' = GS_FONT .
    SET PROPERTY OF GS_FONT 'Bold' = 1 .
    free object h_excelor
    or
    CALL FUNCTION 'GRAPH_MATRIX_3D'

  • Delete a column in excel sheet through POI?

    hi
    Can anyone help me out on physically deleting a column in Excel using POI framework?
    Though I am able to remove indidual cells,the cells remain blank. I want them be completly removed from the sheet.
    pls help

    Soph wrote:
    hi
    Can anyone help me out on physically deleting a column in Excel using POI framework?
    Though I am able to remove indidual cells,the cells remain blank. I want them be completly removed from the sheet.
    pls helpCan you do it in the Excel in your PC? I bet not
    Then you are able to help me how to generate a chart in Excel using POI :D :D
    But first, where to download POI library, Thanks
    {EDIT} found it never mind
    Edited by: mycoffee on Jul 1, 2010 12:15 PM

  • Format Excel sheet - Oracle COM Automation

    Dear gentlemen,
    I would like to get your help to generate a formatted excel sheet using Oracle COM Automation, I may don’t know the correct properties to use, or don’t know how to use it.
    For example:
    To set a cell value I use this line:
    hresult:=Ordcom.SetProperty(RangeHandle, 'Value', data, 'BSTR');
    and when I tried to fill the same cell with a yello color I used this line:
    hresult:=Ordcom.SetProperty(RangeHandle, 'Interior.Color', 65535, 'BSTR');
    but that has no effect at all, so please advise what is wrong, this may apply also for the most properties such as “Font.Bold”.
    I appreciate so much any help from you.
    Best regards,
    Nabil

    Here is another version of my package ORDExcelSB. It includes almost all the formatting needs in Excel.
    Package Specification:_
    CREATE OR REPLACE PACKAGE ORDExcelSB AS
      /* Saubhik: These constants are added */
        BorderEdgeLeft CONSTANT BINARY_INTEGER:= 7;
        BorderEdgeTop CONSTANT BINARY_INTEGER:=8;
        BorderEdgeBottom CONSTANT BINARY_INTEGER:=9;
        BorderEdgeRight CONSTANT BINARY_INTEGER:=10;
        BorderInsideVertical CONSTANT BINARY_INTEGER:=11;
        BorderInsideHorizontal CONSTANT BINARY_INTEGER:=12;
      /* Declare externally callable subprograms. */
      /* Start: These functions are newly aded by Saubhik Banerjee */
      FUNCTION CreateExcelApplication(servername VARCHAR2) RETURN binary_integer;
      FUNCTION OpenExcelFile(filename VARCHAR2, sheetname VARCHAR2)
        RETURN binary_integer;
      FUNCTION SetCellColor(range varchar2, style INTEGER)
        return binary_integer;
      FUNCTION SetCellBorder(range varchar2, BordersIndex BINARY_INTEGER, BorderStyle BINARY_INTEGER)
        return binary_integer;   
      FUNCTION FormatFontStyle(range varchar2, fontstyle varchar2)
        return binary_integer;   
      FUNCTION FormatFontColor(range varchar2, fontcolor INTEGER)
        return binary_integer;   
      FUNCTION FormatFontName(range varchar2, fontname varchar2)
        return binary_integer;  
      FUNCTION FormatFontSize(range varchar2, fontsize INTEGER)
        return binary_integer ;  
      /* End: These functions are newly aded by Saubhik Banerjee */
      FUNCTION CreateExcelWorkSheet(servername varchar2) return binary_integer;
      FUNCTION InsertData(range varchar2, data binary_integer, type varchar2)
        return binary_integer;
      FUNCTION InsertDataReal(range varchar2,
                              data  double precision,
                              type  varchar2) return binary_integer;
      FUNCTION GetDataNum(range varchar2) return binary_integer;
      FUNCTION GetDataStr(range varchar2) return varchar2;
      FUNCTION GetDataReal(range varchar2) return double precision;
      FUNCTION GetDataDate(range varchar2) return date;
      FUNCTION InsertData(range varchar2, data varchar2, type varchar2)
        return binary_integer;
      FUNCTION InsertData(range varchar2, data Date, type varchar2)
        return binary_integer;
      FUNCTION InsertChart(xpos   binary_integer,
                           ypos   binary_integer,
                           width  binary_integer,
                           height binary_integer,
                           range  varchar2,
                           type   varchar2) return binary_integer;
      FUNCTION SaveExcelFile(filename varchar2) return binary_integer;
      FUNCTION ExitExcel return binary_integer;
    END ORDExcelSB;
    Package Body:_
    CREATE OR REPLACE PACKAGE BODY ORDExcelSB AS
      DummyToken        binary_integer;
      applicationToken  binary_integer := -1;
      WorkBooksToken    binary_integer := -1;
      WorkBookToken     binary_integer := -1;
      WorkSheetToken    binary_integer := -1;
      WorkSheetToken1   binary_integer := -1;
      RangeToken        binary_integer := -1;
      ChartObjectToken  binary_integer := -1;
      ChartObject1      binary_integer := -1;
      Chart1Token       binary_integer := -1;
      i                 binary_integer;
      retNum            binary_integer;
      retReal           double precision;
      retStr            varchar2(255);
      retDate           DATE;
      error_src         varchar2(255);
      error_description varchar2(255);
      error_helpfile    varchar2(255);
      error_helpID      binary_integer;
      FUNCTION CreateExcelApplication(servername VARCHAR2) RETURN binary_integer IS
      BEGIN
        dbms_output.put_line('Creating Excel application...');
        i := OrdCOM.CreateObject('Excel.Application',
                                 0,
                                 servername,
                                 applicationToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        dbms_output.put_line('Invoking Workbooks...');
        i := ORDCOM.GetProperty(applicationToken,
                                'WorkBooks',
                                0,
                                WorkBooksToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        RETURN i;
      END CreateExcelApplication;
      FUNCTION OpenExcelFile(filename VARCHAR2, sheetname VARCHAR2)
        RETURN binary_integer IS
      BEGIN
        dbms_output.put_line('Opening Excel file ' || filename || ' ...');
        ORDCOM.InitArg();
        ORDCOM.SetArg(filename, 'BSTR');
        i := ORDCOM.Invoke(WorkBooksToken, 'Open', 1, DummyToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        dbms_output.put_line('Opening WorkBook');
        i := ORDCOM.GetProperty(applicationToken,
                                'ActiveWorkbook',
                                0,
                                WorkBookToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        dbms_output.put_line('Invoking WorkSheets..');
        i := ORDCOM.GetProperty(applicationToken,
                                'WorkSheets',
                                0,
                                WorkSheetToken1);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        dbms_output.put_line('Invoking WorkSheet');
        ORDCOM.InitArg();
        ORDCOM.SetArg(sheetname, 'BSTR');
        i := ORDCOM.GetProperty(WorkBookToken, 'Sheets', 1, WorkSheetToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        dbms_output.put_line('Opened ');
        RETURN i;
      END OpenExcelFile;
      * Invoke the Excel Automation Server and create a Workbook object as
      * well as a worksheet object
      FUNCTION CreateExcelWorkSheet(servername varchar2) return binary_integer IS
      BEGIN
        dbms_output.put_line('Creating Excel application...');
        i := ORDCOM.CreateObject('Excel.Application',
                                 0,
                                 servername,
                                 applicationToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        dbms_output.put_line('Invoking Workbooks...');
        /*i:=ORDCOM.Invoke(applicationToken, 'WorkBooks',0, WorkBooksToken);*/
        i := ORDCOM.GetProperty(applicationToken,
                                'WorkBooks',
                                0,
                                WorkBooksToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        dbms_output.put_line('Invoking Add to WorkBooks...');
        ORDCOM.InitArg();
        ORDCOM.SetArg(-4167, 'I4');
        i := ORDCOM.Invoke(WorkBooksToken, 'Add', 1, WorkBookToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        dbms_output.put_line('Invoking WorkSheets..');
        ORDCOM.InitArg();
        ORDCOM.SetArg('Sheet 1', 'BSTR');
        /*  i:=ORDCOM.Invoke(applicationToken, 'WorkSheets', 1, WorkSheetToken);*/
        i := ORDCOM.GetProperty(applicationToken,
                                'WorkSheets',
                                0,
                                WorkSheetToken1);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.Invoke(WorkSheetToken1, 'Add', 0, WorkSheetToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        return i;
      END CreateExcelWorkSheet;
      * Invoke the Range method to obtain a range token. Then set the property value
      * at the specified range to the data required
      FUNCTION InsertData(range varchar2, data binary_integer, type varchar2)
        RETURN binary_integer IS
      BEGIN
        ORDCOM.InitArg();
        ORDCOM.SetArg(range, 'BSTR');
        i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.SetProperty(RangeToken, 'Value', data, type);
        IF (i = 0) THEN
          i := ORDCOM.SetProperty(RangeToken, 'ColumnWidth', 15, 'I2');
        END IF;
        i := ORDCOM.DestroyObject(RangeToken);
        RETURN i;
      END InsertData;
    /* Saubhik: This function is added to set the cell Border */
      FUNCTION SetCellBorder(range varchar2, BordersIndex BINARY_INTEGER, BorderStyle BINARY_INTEGER)
        return binary_integer IS
        --fontToken binary_integer;
        BorderToken BINARY_INTEGER;
       BEGIN
           ORDCOM.InitArg();
          ORDCOM.SetArg(range, 'BSTR');
          i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
          ORDCOM.InitArg();
          ORDCOM.SetArg(BordersIndex, 'I2');
          i := ORDCOM.GetProperty(RangeToken, 'Borders', 1, BorderToken);
          i := ORDCOM.SetProperty(BorderToken, 'weight', BorderStyle, 'I2');
          i := ORDCOM.DestroyObject(BorderToken);
          i := ORDCOM.DestroyObject(RangeToken);
          return i;
        END SetCellBorder; 
    /* Saubhik: This function is added to set the cell background color */
      FUNCTION SetCellColor(range varchar2, style INTEGER)
        return binary_integer IS
        --fontToken binary_integer;
        DummyToken BINARY_INTEGER;
        SelectionToken BINARY_INTEGER;
        InteriorToken BINARY_INTEGER;
        --applicationToken
          BEGIN
          ORDCOM.InitArg();
          ORDCOM.SetArg(range, 'BSTR');
          i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
          i := ORDCOM.Invoke(RangeToken,'SELECT',0,DummyToken);
          i := ORDCOM.GetProperty(applicationToken,'Selection',0,SelectionToken);
          i := ORDCOM.GetProperty(SelectionToken, 'Interior', 0, InteriorToken);
          i := ORDCOM.SetProperty(InteriorToken, 'ColorIndex', style, 'I2');
          i := ORDCOM.DestroyObject(RangeToken);
          return i;
        END SetCellColor;
    /* Saubhik: This function is added to change the font style like Bold, Italic etc. */
      FUNCTION FormatFontStyle(range varchar2, fontstyle varchar2)
        return binary_integer IS
        fontToken binary_integer;
          BEGIN
          ORDCOM.InitArg();
          ORDCOM.SetArg(range, 'BSTR');
          i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
          i := ORDCOM.GetProperty(RangeToken, 'Font', 0, FontToken);
          IF fontstyle = 'Bold' OR fontstyle = 'Italic' OR
             fontstyle = 'Underline' THEN
              i := ORDCOM.SetProperty(FontToken, fontstyle, True, 'BOOL');
          END IF;
          i := ORDCOM.DestroyObject(FontToken);
          i := ORDCOM.DestroyObject(RangeToken);
          return i;
        END FormatFontStyle;
    /* Saubhik: This function is added to change the font style like Arial, Bookman, Century etc. */
      FUNCTION FormatFontName(range varchar2, fontname varchar2)
        return binary_integer IS
        fontToken binary_integer;
          BEGIN
          ORDCOM.InitArg();
          ORDCOM.SetArg(range, 'BSTR');
          i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
          i := ORDCOM.GetProperty(RangeToken, 'Font', 0, FontToken);
          i := ORDCOM.SetProperty(FontToken, 'Name', fontname, 'BSTR');
          i := ORDCOM.DestroyObject(FontToken);
          i := ORDCOM.DestroyObject(RangeToken);
          return i;
        END FormatFontName;   
      /* Saubhik: This function is added to change the font style like Arial, Bookman, Century etc. */
      FUNCTION FormatFontSize(range varchar2, fontsize INTEGER)
        return binary_integer IS
        fontToken binary_integer;
          BEGIN
          ORDCOM.InitArg();
          ORDCOM.SetArg(range, 'BSTR');
          i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
          i := ORDCOM.GetProperty(RangeToken, 'Font', 0, FontToken);
          i := ORDCOM.SetProperty(FontToken, 'Size', fontsize, 'I2');
          i := ORDCOM.DestroyObject(FontToken);
          i := ORDCOM.DestroyObject(RangeToken);
          return i;
        END FormatFontSize;   
    /* Saubhik: This function is added to change the font color like Black, Blue etc. */
      FUNCTION FormatFontColor(range varchar2, fontcolor INTEGER)
        return binary_integer IS
        fontToken binary_integer;
          BEGIN
          ORDCOM.InitArg();
          ORDCOM.SetArg(range, 'BSTR');
          i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
          i := ORDCOM.GetProperty(RangeToken, 'Font', 0, FontToken);
              i := ORDCOM.SetProperty(FontToken, 'ColorIndex', fontcolor, 'I2');
          i := ORDCOM.DestroyObject(FontToken);
          i := ORDCOM.DestroyObject(RangeToken);
          return i;
        END FormatFontColor;
      * Invoke the Range method to obtain a range token. Then set the property value
      * at the specified range to the data required
      FUNCTION GetDataNum(range varchar2) RETURN binary_integer IS
      BEGIN
        ORDCOM.InitArg();
        ORDCOM.SetArg(range, 'BSTR');
        i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.GetProperty(RangeToken, 'Value', 0, retNum);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.DestroyObject(RangeToken);
        RETURN retNum;
      END GetDataNum;
      FUNCTION GetDataReal(range varchar2) RETURN double precision IS
      BEGIN
        ORDCOM.InitArg();
        ORDCOM.SetArg(range, 'BSTR');
        i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.GetProperty(RangeToken, 'Value', 0, retReal);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.DestroyObject(RangeToken);
        RETURN retReal;
      END GetDataReal;
      FUNCTION GetDataStr(range varchar2) RETURN varchar2 IS
      BEGIN
        ORDCOM.InitArg();
        ORDCOM.SetArg(range, 'BSTR');
        i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.GetProperty(RangeToken, 'Value', 0, retStr);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.DestroyObject(RangeToken);
        RETURN retStr;
      END GetDataStr;
      FUNCTION GetDataDate(range varchar2) RETURN Date IS
      BEGIN
        ORDCOM.InitArg();
        ORDCOM.SetArg(range, 'BSTR');
        i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.GetProperty(RangeToken, 'Value', 0, retDate);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.DestroyObject(RangeToken);
        RETURN retDate;
      END GetDataDate;
      FUNCTION InsertData(range varchar2, data DATE, type varchar2)
        RETURN binary_integer IS
      BEGIN
        ORDCOM.InitArg();
        ORDCOM.SetArg(range, 'BSTR');
        i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
        i := ORDCOM.SetProperty(RangeToken, 'Value', data, type);
        i := ORDCOM.DestroyObject(RangeToken);
        RETURN i;
      END InsertData;
      FUNCTION InsertDataReal(range varchar2,
                              data  double precision,
                              type  varchar2) RETURN binary_integer IS
      BEGIN
        ORDCOM.InitArg();
        ORDCOM.SetArg(range, 'BSTR');
        i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
        i := ORDCOM.SetProperty(RangeToken, 'Value', data, type);
        i := ORDCOM.DestroyObject(RangeToken);
        RETURN i;
      END InsertDataReal;
      FUNCTION InsertData(range varchar2, data varchar2, type varchar2)
        RETURN binary_integer IS
      BEGIN
        ORDCOM.InitArg();
        ORDCOM.SetArg(range, 'BSTR');
        i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
        i := ORDCOM.SetProperty(RangeToken, 'Value', data, type);
        i := ORDCOM.DestroyObject(RangeToken);
        RETURN i;
      END InsertData;
      * Insert a chart at the x and y position of the spreadsheet with the desired
      * height and width. Then also uses the ChartWizard to draw the graph with data
      * in a specified range area with a specified charting type.
      FUNCTION InsertChart(xpos   binary_integer,
                           ypos   binary_integer,
                           width  binary_integer,
                           height binary_integer,
                           range  varchar2,
                           type   varchar2) RETURN binary_integer IS
        charttype binary_integer := -4099;
      BEGIN
        ORDCOM.InitArg();
        i := ORDCOM.GetProperty(WorkSheetToken,
                                'ChartObjects',
                                0,
                                ChartObjectToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        ORDCOM.InitArg();
        ORDCOM.SetArg(xpos, 'I2');
        ORDCOM.SetArg(ypos, 'I2');
        ORDCOM.SetArg(width, 'I2');
        ORDCOM.SetArg(height, 'I2');
        i := ORDCOM.Invoke(ChartObjectToken, 'Add', 4, ChartObject1);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.GetProperty(ChartObject1, 'Chart', 0, Chart1Token);
        ORDCOM.InitArg();
        ORDCOM.SetArg(range, 'BSTR');
        i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
        ORDCOM.InitArg();
        ORDCOM.SetArg(RangeToken, 'DISPATCH');
        IF type = 'xlPie' THEN
          charttype := -4102;
        ELSIF type = 'xl3DBar' THEN
          charttype := -4099;
        ELSIF type = 'xlBar' THEN
          charttype := 2;
        ELSIF type = 'xl3dLine' THEN
          charttype := -4101;
        END IF;
        ORDCOM.SetArg(charttype, 'I4');
        i := ORDCOM.Invoke(Chart1Token, 'ChartWizard', 2, DummyToken);
        i := ORDCOM.DestroyObject(RangeToken);
        i := ORDCOM.DestroyObject(ChartObjectToken);
        i := ORDCOM.DestroyObject(ChartObject1);
        i := ORDCOM.DestroyObject(Chart1Token);
        RETURN i;
      END InsertChart;
      * Save the Excel File. WARNING: Do not specify a filename that already exist
      * since there is no graphical context, Oracle would not be able to pop
      * out a warning message for existing file. This causes Excel to hang
      FUNCTION SaveExcelFile(filename varchar2) return binary_integer IS
      BEGIN
        dbms_output.put_line('Saving Excel file...');
        ORDCOM.InitArg();
        ORDCOM.SetArg(filename, 'BSTR');
        i := ORDCOM.Invoke(WorkBookToken, 'SaveAs', 1, DummyToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        RETURN i;
      END SaveExcelFile;
      * Close the Excel spreadsheet and exit from it
      FUNCTION ExitExcel return binary_integer is
      BEGIN
        dbms_output.put_line('Closing workbook and quitting...');
        ORDCOM.InitArg();
        ORDCOM.InitArg();
        ORDCOM.SetArg(FALSE, 'BOOL');
        dbms_output.put_line('Closing workbook...');
        i := ORDCOM.Invoke(WorkBookToken, 'Close', 0, DummyToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.DestroyObject(WorkBookToken);
        ORDCOM.InitArg();
        dbms_output.put_line('Closing workbooks...');
        i := ORDCOM.Invoke(WorkBooksToken, 'Close', 0, DummyToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.DestroyObject(WorkBooksToken);
        i := ORDCOM.Invoke(applicationToken, 'Quit', 0, DummyToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.DestroyObject(WorkSheetToken);
        i := ORDCOM.DestroyObject(WorkSheetToken1);
        i := ORDCOM.DestroyObject(applicationToken);
        i := ORDCOM.DestroyObject(ChartObjectToken);
        i := ORDCOM.DestroyObject(Chart1Token);
        i := ORDCOM.DestroyObject(ChartObject1);
        i := ORDCOM.DestroyObject(dummyToken);
        RETURN i;
      END ExitExcel;
    END ORDExcelSB;

Maybe you are looking for