Generating Excel using Client_ole2

Hi
I am using the following codde to generate excel file from form but when i click on button nothing happens and i can not exit the form also... please help me...
thanks.....
DECLARE
     A BOOLEAN;
     args client_ole2.list_type;
     application client_ole2.obj_type;
     vworkbooks client_ole2.obj_type;
     vdoc client_ole2.obj_type;
     vworksheet client_ole2.obj_type;
     vrange client_ole2.obj_type;
BEGIN
-- create app object
application := client_ole2.create_obj('Excel.Application');
client_OLE2.SET_PROPERTY(application, 'Visible','True');
-- get workbooks object
vworkbooks := client_ole2.get_obj_property(application, 'Workbooks');
-- and open a file
args := client_ole2.create_arglist;
client_ole2.ADD_ARG(args, 'c:\tp_ae.xls');
vdoc :=client_ole2.INVOKE_OBJ(vworkbooks,'Open',args);
client_ole2.destroy_arglist(args);
-- get a worksheet object
-- for this to work you need to know the sheet name or its index
args := client_ole2.create_arglist;
client_ole2.ADD_ARG(args, 1); --<-- name or index
vworksheet := client_ole2.get_obj_property(vdoc,'Worksheets',args);
client_ole2.destroy_arglist(args);
-- get a range object which in this case is just a cell
-- for this to work you need to know the cell coordinates
args := client_ole2.create_arglist;
client_ole2.ADD_ARG(args, 'B6');
vrange := client_ole2.get_obj_property(vworksheet,'Range',args);
client_ole2.destroy_arglist(args);
-- and here you get the value
message(client_ole2.get_char_property(vrange,'Value'));
-- release objects
client_ole2.release_obj(vrange);
client_ole2.release_obj(vworksheet);
client_ole2.release_obj(vdoc);
client_ole2.release_obj(vworkbooks);
client_ole2.release_obj(application);
END;

hi
if you want to export the data to excel then use the following code and the following code u can use any schema and it will export all data with headers.
PROCEDURE fpr_forms_to_excel(p_block_name in varchar2 default NAME_IN('system.current_block'),
                                                                       p_path                in varchar2 default 'C:\',
                                                                       p_file_name      in varchar2 default 'Temp') IS
-- Declare the OLE objects
     application                          OLE2.OBJ_TYPE;
     workbooks                               OLE2.OBJ_TYPE;
     workbook                                    OLE2.OBJ_TYPE;
     worksheets                               OLE2.OBJ_TYPE;
     worksheet                               OLE2.OBJ_TYPE;
     cell                                              OLE2.OBJ_TYPE;
     range                                         OLE2.OBJ_TYPE;
     range_col                               OLE2.OBJ_TYPE;
     -- Declare handles to OLE argument lists
     args                                           OLE2.LIST_TYPE;
     arglist                                     OLE2.LIST_TYPE;
     -- Declare form and block items
     form_name                               VARCHAR2(100);
     f_block                                    VARCHAR2(100);
     l_block                                    VARCHAR2(100);
     f_item                                         VARCHAR2(100);
     l_item                                         VARCHAR2(100);
     cur_block                               VARCHAR2(100):= NAME_IN('system.current_block');
     cur_item                                    VARCHAR2(100);
     cur_record                               VARCHAR2(100);
     item_name                               VARCHAR2(100);
     baslik                                         VARCHAR2(100);
     row_n                                         NUMBER;
     col_n                                         NUMBER;
     filename                                    VARCHAR2(1000):= p_path||p_file_name;
     ExcelFontId                          OLE2.list_type;
BEGIN
          -- Start Excel
          application:=OLE2.CREATE_OBJ('Excel.Application');
          OLE2.SET_PROPERTY(application, 'Visible', 'False');
          -- Return object handle to the Workbooks collection
          workbooks:=OLE2.GET_OBJ_PROPERTY(application, 'Workbooks');
          -- Add a new Workbook object to the Workbooks collection
          workbook:=OLE2.GET_OBJ_PROPERTY(workbooks,'Add');
          -- Return object handle to the Worksheets collection for the Workbook
          worksheets:=OLE2.GET_OBJ_PROPERTY(workbook, 'Worksheets');
          -- Get the first Worksheet in the Worksheets collection
          -- worksheet:=OLE2.GET_OBJ_PROPERTY(worksheets,'Add');
          args:=OLE2.CREATE_ARGLIST;
          OLE2.ADD_ARG(args, 1);
          worksheet:=OLE2.GET_OBJ_PROPERTY(worksheets,'Item',args);
          OLE2.DESTROY_ARGLIST(args);
          -- Return object handle to cell A1 on the new Worksheet
          go_block(p_block_name);
          baslik := get_block_property(p_block_name,FIRST_ITEM);                                                  --commented to consider the second item as the first item
          f_item := p_block_name||'.'||get_block_property(p_block_name,FIRST_ITEM); --in order to skip the old filename in the excel file
          l_item := p_block_name||'.'||get_block_property(p_block_name,LAST_ITEM);
          first_record;
          LOOP
              item_name := f_item;
              row_n := NAME_IN('SYSTEM.CURSOR_RECORD');
              col_n := 1;
                    LOOP
                         IF get_item_property(item_name,ITEM_TYPE)<>'BUTTON' AND get_item_property(item_name,VISIBLE)='TRUE' THEN
                         -- Set first row with the item names
                               IF row_n=1 THEN
                                        args := OLE2.create_arglist;
                                        OLE2.add_arg(args, 1);
                                        OLE2.add_arg(args, col_n);
                                        cell := OLE2.get_obj_property(worksheet, 'Cells', args);
                                        OLE2.destroy_arglist(args);
                                        --cell_value := OLE2.get_char_property(cell, 'Value');
                                        ExcelFontId := OLE2.get_obj_property(Cell, 'Font');
                                        OLE2.set_property(ExcelFontId, 'Bold', 'True');
                                        baslik:=NVL(get_item_property(item_name,PROMPT_TEXT),baslik);
                                        args:=OLE2.CREATE_ARGLIST;
                                        OLE2.ADD_ARG(args, row_n);
                                        OLE2.ADD_ARG(args, col_n);
                                        cell:=OLE2.GET_OBJ_PROPERTY(worksheet, 'Cells', args);
                                        OLE2.DESTROY_ARGLIST(args);
                                        OLE2.SET_PROPERTY(cell, 'Value', baslik);
                                        OLE2.RELEASE_OBJ(cell);
                               END IF;
                         -- Set other rows with the item values
                                   args:=OLE2.CREATE_ARGLIST;
                                   OLE2.ADD_ARG(args, row_n+1);
                                   :control.message:=row_n||' Row(s) Processed.';
                            synchronize;
                                   OLE2.ADD_ARG(args, col_n);
                                   cell:=OLE2.GET_OBJ_PROPERTY(worksheet, 'Cells', args);
                                   OLE2.DESTROY_ARGLIST(args);
                              IF get_item_property(item_name,DATATYPE)<>'NUMBER' THEN
                                    OLE2.SET_PROPERTY(cell, 'NumberFormat', '@');
                              END IF;
                                   OLE2.SET_PROPERTY(cell, 'Value', name_in(item_name));
                                   OLE2.RELEASE_OBJ(cell);
                         END IF;
                         IF item_name = l_item THEN
                               exit;
                         END IF;
                         baslik := get_item_property(item_name,NEXTITEM);
                         item_name := p_block_name||'.'||get_item_property(item_name,NEXTITEM);
                         col_n := col_n + 1;
                    END LOOP;
          EXIT WHEN NAME_IN('system.last_record') = 'TRUE';
          --exit;
                     NEXT_RECORD;
          END LOOP;
          -- Autofit columns
          range := OLE2.GET_OBJ_PROPERTY( worksheet,'UsedRange');
          range_col := OLE2.GET_OBJ_PROPERTY( range,'Columns');
          OLE2.INVOKE( range_col,'AutoFit' );
          OLE2.RELEASE_OBJ( range );
          OLE2.RELEASE_OBJ( range_col );
          -- Save as worksheet with a Specified file path & name.
           IF NVL(filename,'0')<>'0' THEN
                args := OLE2.CREATE_ARGLIST;
                        OLE2.ADD_ARG(args,filename );
                                     OLE2.INVOKE(worksheet,'SaveAs',args );
                                     OLE2.DESTROY_ARGLIST( args );
          END IF;
          --      Release the OLE objects
          OLE2.RELEASE_OBJ(worksheet);
          OLE2.RELEASE_OBJ(worksheets);
          OLE2.RELEASE_OBJ(workbook);
          OLE2.RELEASE_OBJ(workbooks);
          OLE2.INVOKE     (application,'Quit');
          OLE2.RELEASE_OBJ(application);
          -- Focus to the original location
exception
     when others then null;
                              raise form_trigger_failure;
END; Note:- As i mentioned in my previouse posts if your webutil is not configured
so the client_ole2 will not work before using client_ole2 u have to configure webutil.
sarah

Similar Messages

  • Not able to write to Excel using Client_OLE2 and webutil

    Hi
    I am working on Windows 2000 Pro SP4 Oracle Forms Builder 10.1.2.0.2
    I am using webutil to invoke Excel Application .
    The following code invokes Excel application and saves in the path specified as Test_Excel and writes the "Test Data to be written" to R1C1 when I use OLE2.
    But when I replace OLE2 with Client_OLE2 the Excel file is getting created but the data is not written to the cell.
    PL/SQL :could not find program unit being called is the error.
    Can anybody help me solve this issue ?
    Thanks in advance.
    FUNCTION WRITE_TO_EXCEL(
    excel_file_name in varchar2, ---for eg.. C:\Test_Excel.xls
    buf in varchar2 ) ----Test Data to be written
    return boolean is
    application CLIENT_OLE2.OBJ_TYPE;
    workbooks CLIENT_OLE2.OBJ_TYPE;
    workbook CLIENT_OLE2.OBJ_TYPE;
    worksheets CLIENT_OLE2.OBJ_TYPE;
    worksheet CLIENT_OLE2.OBJ_TYPE;
    cell CLIENT_OLE2.OBJ_TYPE;
    args CLIENT_OLE2.LIST_TYPE;
    begin
    application := CLIENT_OLE2.CREATE_OBJ ('Excel.Application');
    CLIENT_OLE2.SET_PROPERTY(application, 'Visible', 'True');
    workbooks := CLIENT_OLE2.GET_OBJ_PROPERTY(application, 'Workbooks');
    workbook := CLIENT_OLE2.Invoke_Obj(workbooks, 'Add');
    worksheets := CLIENT_OLE2.Get_Obj_Property(workbook, 'Worksheets');
    worksheet := CLIENT_OLE2.Invoke_Obj(worksheets,'Add');
    args:=CLIENT_OLE2.create_arglist;
    CLIENT_OLE2.add_arg(args,1);
    CLIENT_OLE2.add_arg(args,1);
    cell:=CLIENT_OLE2.get_obj_property(worksheet, 'Cells', args);
    CLIENT_OLE2.destroy_arglist(args);
    CLIENT_OLE2.set_property(cell,'Value', buf);
    CLIENT_OLE2.release_obj(cell);
    CLIENT_OLE2.Release_Obj(worksheet);
    CLIENT_OLE2.Release_Obj(worksheets);
    args := CLIENT_OLE2.Create_Arglist;
    CLIENT_OLE2.Add_Arg(args,excel_file_name);
    CLIENT_OLE2.Invoke(workbook, 'SaveAs', args);
    CLIENT_OLE2.Destroy_Arglist(args);
    args := CLIENT_OLE2.CREATE_ARGLIST;
    CLIENT_OLE2.ADD_ARG(args,'Caption');
    CLIENT_OLE2.INVOKE(application,'Run',args);
    CLIENT_OLE2.destroy_arglist(args);
    CLIENT_OLE2.Release_Obj(workbook);
    CLIENT_OLE2.Release_Obj(workbooks);
    CLIENT_OLE2.Invoke(application, 'Quit');
    CLIENT_OLE2.Release_Obj(application);
    return(TRUE);
    exception
    when others then
    message (error_type||'-'||error_code||':'||error_text);
    message (' ');
    SET_APPLICATION_PROPERTY(CURSOR_STYLE,'default');
    CLIENT_OLE2.RELEASE_OBJ(application);
    CLIENT_OLE2.RELEASE_OBJ(workbooks);
    CLIENT_OLE2.RELEASE_OBJ(workbook);
    CLIENT_OLE2.release_obj(worksheet);
    CLIENT_OLE2.release_obj(worksheets);
    return(FALSE);
    END;

    What line is actually causing the error? Also, I assume you tested the exact same code which works when using straight OLE2 (and not the webutil client_ version)?
    Regards
    Grant Ronald
    Oracle Product Management

  • Column Headers in Excel using CLIENT_OLE2

    Hello guys,
    I have muti record block that has 10 columns which I want to display in Excel. I created a procedure RUN_EXCEL and everything works fine when the button is pressed and the procedure is called. However, I want to add the column prompts and when I try to do that using the prompt text I get the column headers but all the rows and colums mess up. Can anyone tell me how to get the column header to work to add in my current procedure. Right now if I run this way it doesn't display the promt headers.
    Thanks
    PROCEDURE RUN_EXCEL IS
    application Client_OLE2.Obj_Type;
    workbooks Client_OLE2.Obj_Type;
    workbook Client_OLE2.Obj_Type;
    worksheets Client_OLE2.Obj_Type;
    worksheet Client_OLE2.Obj_Type;
    args Client_OLE2.List_Type;
    cell client_ole2.Obj_Type;
    font client_ole2.obj_type;
    range client_ole2.obj_type;
    range_col client_ole2.obj_type;
    item_prompt VARCHAR2(32767);
    j INTEGER;
    k INTEGER;
    l INTEGER;
    BEGIN
    application := Client_OLE2.create_obj('Excel.Application');
    Client_OLE2.Set_Property ( application , 'visible', 1);
    workbooks := Client_OLE2.Get_Obj_Property(application, 'Workbooks');
    workbook := Client_OLE2.Invoke_Obj(workbooks, 'Add');
    worksheets := Client_OLE2.Get_Obj_Property(workbook, 'Worksheets');
    worksheet := Client_OLE2.Invoke_Obj(worksheets, 'Add');
    go_block('DM_T_EXCEPTION_LOG');
    first_record;
    j:=1;
    k:=1;
    while :system.last_record = 'FALSE'
    loop
    for k in 1..10 /* Table has 10 columns */
    loop
    If not name_in(:system.cursor_item) is NULL Then
         item_prompt := get_item_property(:SYSTEM.CURRENT_BLOCK||'.'||:SYSTEM.CURRENT_ITEM, prompt_text);
    args:=Client_OLE2.create_arglist;
    Client_OLE2.add_arg(args, j);
    Client_OLE2.add_arg(args, k);
    cell:=Client_OLE2.get_obj_property(worksheet, 'Cells', args);
    Client_OLE2.destroy_arglist(args);
    Client_OLE2.set_property(cell, 'Value', name_in(:system.cursor_item));
    Client_OLE2.release_obj(cell);
    range := client_ole2.get_obj_property (worksheet, 'UsedRange');
    range_col := client_ole2.get_obj_property (range, 'Columns');
    client_ole2.invoke (range_col, 'AutoFit');
    End If;
    next_item;
    end loop;
    j:=j+1;
    next_record;
    end loop;
    /* For the last record */
    for k in 1..10
    loop
    If not name_in(:system.cursor_item) is NULL Then
    args:=Client_OLE2.create_arglist;
    Client_OLE2.add_arg(args, j);
    Client_OLE2.add_arg(args, k);
    cell:=Client_OLE2.get_obj_property(worksheet, 'Cells', args);
    Client_OLE2.destroy_arglist(args);
    Client_OLE2.set_property(cell, 'Value', name_in(:system.cursor_item));
    -- imessage('in k again'||' '||:system.cursor_item||' '||item_prompt);
    Client_OLE2.release_obj(cell);
    range := client_ole2.get_obj_property (worksheet, 'UsedRange');
    range_col := client_ole2.get_obj_property (range, 'Columns');
    client_ole2.invoke (range_col, 'AutoFit');
    End If;
    next_item;
    end loop;
    ole2.set_property(application, 'Visible', 'false');
    client_ole2.release_obj (range);
    client_ole2.release_obj (range_col);
    Client_OLE2.Release_Obj(worksheet);
    Client_OLE2.Release_Obj(worksheets);
    END;

    Re:  Problem area in code
    "Match" is a worksheet function and is not used in VBA unless it is identified as a worksheet function, such as...
      X = Application.WorksheetFunction.Match(arg, arg, arg)
    Jim Cone
    Portland, Oregon USA
    free 'Save Selection as Picture' excel add-in
    (a couple of clicks & you have a picture file of the selected cells)
    https://jumpshare.com/b/O5FC6LaBQ6U3UPXjOmX2

  • Error in generating Excel using EXCEL_OLE_STANDARD_DAT

    Hi,
    While generating an Excel using EXCEL_OLE_STANDARD_DAT, the files are getting genrated but it also gives an
    "OLE_OBJECT_METHOD_ERROR" (only on some PC's).
    Why do we get this error and how will I be able to resolve it ?
    Thanks in advance,
    Archana

    Hi Archana,
    Have a look at OSS Notes 104165 and 691875. Hope these notes give some inputs.
    Thanks
    Lakshman

  • Export to excel using client_ole2

    Hi everyone
    i am using the following code to write to excel
    -- Start Excel and make it visible
    application := CLIENT_OLE2.create_obj ('Excel.Application');
    CLIENT_OLE2.set_property (application, 'Visible', 'True');
    -- Return object handle to the Workbooks collection
    workbooks := CLIENT_OLE2.get_obj_property (application, 'Workbooks');
    --- open Workbook object to the Workbooks collection
    workbook := CLIENT_OLE2.invoke_obj(workbooks, 'ADD');
    -- Open worksheet Sheet1 of that Workbook
    worksheets := CLIENT_ole2.get_obj_property (workbook, 'Worksheets');
    worksheet := CLIENT_ole2.invoke_obj (worksheets, 'ADD');
    CLIENT_ole2.set_property (worksheet, 'NAME','ΠΩΛΗΣΕΙΣ');
    My problem is that in the last command when i use grek characters('ΠΩΛΗΣΕΙΣ') i get the message
    WUO-712 com.jacob.com.comfailexception:invoke of name source:microsoft office excel
    Any ideas?
    Thanks Hermes

    Hi
    finally i get the excel but with question marks in columns with greek characters.This is a nls_lang problem
    Pls answer urself on these questions...
    1. did u change it to Greek in ur Windows Registery... ?
    2.Did - the most important - ur windows has Greek characters installed ?
    if the answer is no pls make sure u have installed it and test it in a note pad before re-trying.
    Hope this helps...
    Regards,
    Ammatu Allah.

  • Example using low level API POI for generating Excel??

    Hi
    is anyone know good URL that teaches generating Excel using low level API using Apache POI?
    The reason is because i want to set the password for either workbook/sheet in high level API but it cant be done.
    the only thing can be done using High level API is protect sheet without password.
    Any idea?
    Thanks

    There is quite a good pack of documentation that ships with HSSF. To answer your question, I have just gone to the how to page and copied the example below, hope it helps.
    short rownum;
    // create a new file
    FileOutputStream out = new FileOutputStream("workbook.xls");
    // create a new workbook
    HSSFWorkbook wb = new HSSFWorkbook();
    // create a new sheet
    HSSFSheet s = wb.createSheet();
    // declare a row object reference
    HSSFRow r = null;
    // declare a cell object reference
    HSSFCell c = null;
    // create 3 cell styles
    HSSFCellStyle cs = wb.createCellStyle();
    HSSFCellStyle cs2 = wb.createCellStyle();
    HSSFCellStyle cs3 = wb.createCellStyle();
    HSSFDataFormat df = wb.createDataFormat();
    // create 2 fonts objects
    HSSFFont f = wb.createFont();
    HSSFFont f2 = wb.createFont();
    //set font 1 to 12 point type
    f.setFontHeightInPoints((short) 12);
    //make it blue
    f.setColor( (short)0xc );
    // make it bold
    //arial is the default font
    f.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
    //set font 2 to 10 point type
    f2.setFontHeightInPoints((short) 10);
    //make it red
    f2.setColor( (short)HSSFFont.COLOR_RED );
    //make it bold
    f2.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
    f2.setStrikeout( true );
    //set cell stlye
    cs.setFont(f);
    //set the cell format
    cs.setDataFormat(df.getFormat("#,##0.0"));
    //set a thin border
    cs2.setBorderBottom(cs2.BORDER_THIN);
    //fill w fg fill color
    cs2.setFillPattern((short) HSSFCellStyle.SOLID_FOREGROUND);
    //set the cell format to text see HSSFDataFormat for a full list
    cs2.setDataFormat(HSSFDataFormat.getBuiltinFormat("text"));
    // set the font
    cs2.setFont(f2);
    // set the sheet name in Unicode
    wb.setSheetName(0, "\u0422\u0435\u0441\u0442\u043E\u0432\u0430\u044F " +
                       "\u0421\u0442\u0440\u0430\u043D\u0438\u0447\u043A\u0430",
                    HSSFWorkbook.ENCODING_UTF_16 );
    // in case of compressed Unicode
    // wb.setSheetName(0, "HSSF Test", HSSFWorkbook.ENCODING_COMPRESSED_UNICODE );
    // create a sheet with 30 rows (0-29)
    for (rownum = (short) 0; rownum < 30; rownum++)
        // create a row
        r = s.createRow(rownum);
        // on every other row
        if ((rownum % 2) == 0)
            // make the row height bigger  (in twips - 1/20 of a point)
            r.setHeight((short) 0x249);
        //r.setRowNum(( short ) rownum);
        // create 10 cells (0-9) (the += 2 becomes apparent later
        for (short cellnum = (short) 0; cellnum < 10; cellnum += 2)
            // create a numeric cell
            c = r.createCell(cellnum);
            // do some goofy math to demonstrate decimals
            c.setCellValue(rownum * 10000 + cellnum
                    + (((double) rownum / 1000)
                    + ((double) cellnum / 10000)));
            String cellValue;
            // create a string cell (see why += 2 in the
            c = r.createCell((short) (cellnum + 1));
            // on every other row
            if ((rownum % 2) == 0)
                // set this cell to the first cell style we defined
                c.setCellStyle(cs);
                // set the cell's string value to "Test"
                c.setEncoding( HSSFCell.ENCODING_COMPRESSED_UNICODE );
                c.setCellValue( "Test" );
            else
                c.setCellStyle(cs2);
                // set the cell's string value to "\u0422\u0435\u0441\u0442"
                c.setEncoding( HSSFCell.ENCODING_UTF_16 );
                c.setCellValue( "\u0422\u0435\u0441\u0442" );
            // make this column a bit wider
            s.setColumnWidth((short) (cellnum + 1), (short) ((50 * 8) / ((double) 1 / 20)));
    //draw a thick black border on the row at the bottom using BLANKS
    // advance 2 rows
    rownum++;
    rownum++;
    r = s.createRow(rownum);
    // define the third style to be the default
    // except with a thick black border at the bottom
    cs3.setBorderBottom(cs3.BORDER_THICK);
    //create 50 cells
    for (short cellnum = (short) 0; cellnum < 50; cellnum++)
        //create a blank type cell (no value)
        c = r.createCell(cellnum);
        // set it to the thick black border style
        c.setCellStyle(cs3);
    //end draw thick black border
    // demonstrate adding/naming and deleting a sheet
    // create a sheet, set its title then delete it
    s = wb.createSheet();
    wb.setSheetName(1, "DeletedSheet");
    wb.removeSheetAt(1);
    //end deleted sheet
    // write the workbook to the output stream
    // close our file (don't blow out our file handles
    wb.write(out);
    out.close();

  • Auto fit columns in excel using open xml

    I have generate excel using open xml and it contain auto fit property for columns. my problem is that the excel is opening very well in kingsoft spreadsheets
    and other tools, but not opening in microsoft excel 2013 and older version. Is there any solution for auto fit columns in excel using open xml and should open in Microsoft excel  all version

    Hi Raj12345,
    >> I have generate excel using open xml and it contain auto fit property for columns. my problem is that the excel is opening very well in kingsoft spreadsheets and other tools, but not opening in microsoft excel 2013 and older version
    I assume you was using OpenXML SDK and I'm afraid we are not able to find the root cause according to your description, would you mind sharing us some code sample to reproduce this issue.
    >> Is there any solution for auto fit columns in excel using open xml and should open in Microsoft excel  all version
    As far as I know, there is no auto fit property for columns in excel with openxml. I am afraid that you need to calculate the column width depending on the cell contents, and then set the column width. The link below shows more details:
    # Solution: How to AutoFit Excel Content
    https://social.msdn.microsoft.com/Forums/office/en-US/28aae308-55cb-479f-9b58-d1797ed46a73/solution-how-to-autofit-excel-content?forum=oxmlsdk
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • Use Of  Type in generating excel

    Hi,
    I have one procedure which generates excel sheet from oracle database by using a type 'ExcelDocumentType'.This type use some member procedures like documentOpen,documentClose,worksheetOpen and some MEMBER FUNCTION getDocument ( which RETURN CLOB) , MEMBER FUNCTION getBDocument ( which RETURN BLOB) etc. Actualy while i run the proc its taking time to execute.
    Can u please suggest, best ways to optimize code and an example for the code which generate excel from oracle.
    Thanks & Regards,

    Lots of examples in the FAQ:
    {message:id=9360007}
    As for how to optimize it, that would be very difficult as we can't see your code.

  • Generating Excel report from java by using POI

    Hi
    Im trying to generate the report in Excel using POI. Im retrieving the data from the table. As per my query its having millions of records.
    For example, Im giving the sheet name as below given
    HSSFSheet sheet      = wb.createSheet("SampleReport_01");
    In a single sheet, 65000 records can be displayed. Im checking this condition also. It exceeds 65000 records, the records will be dislayed in the next sheet "SampleReport_02","SampleReport_03" and so on. Im incrementing this count 01, 02 , 03 and so on.
    While generating the report, its giving out of memory exception.
    Can anyone suggest, this is because of huge volume of data? If so, how to handle this one.
    Thanks in Advance
    Dhilip

    your workbook object is in the jvm memory. putting so much data in it while working with it will take memory allocated to jvm.
    better solution is to make a .csv file. Add the data in it with through append (check this [http://www.javacoffeebreak.com/faq/faq0086.html|http://www.javacoffeebreak.com/faq/faq0086.html] ) .
    latter import the .csv file into excel sheet manually.

  • Need to generate excel(or CSV format) report using Oracle10g PL/SQL

    Hi Guys,
    I want to generate excel/csv report dynamically using PL/SQL, as I am presently running one SQL query to fetch results and extract excel file. This I need to do dynamically by using PL/SQL code.
    Also the generated file need to send to couple of recepients via mail, this process shall I do it from Oracle ?
    Can any body help on this.
    Thanks in advance!!
    Regards,
    KLR

    UTL_FILE
    UTL_MAIL
    https://forums.oracle.com/thread/2609119
    Ramin Hashimzade

  • How to generate excel file as output using OWB

    Hi,
    I have a requirement to generate an excel file as output using OWB.
    I am trying for a direct approach to create excel files.
    Though I know that excel can be created from a .csv file, I am looking for a direct approach to generate excel file without involving any .csv to excel conversion externally.
    Regards,
    Sri

    so, we are trying to do it by the help of oracle heterogeneous services. In my opinion it is possible (it depends on feature of ODCB Excel driver)
    For more details look at thread (it is about MS SQL Server but maybe it helps)
    Oracle to SQL SERVER
    Regards,
    Oleg

  • How to generate excel file in oracle forms 10g on client machine

    dear Sir,
    I am using just file server(installed 10g dev suite) not a oracle application server,
    I am running my application from another machine ,it running fine i want to generate excel report on client machine
    presently i m using OLE2 for fetching the data in excel , it is working fine but it generates the excel file on file server machine and i want get the output excel on the client machine. aftre OLE2 i m using CLIENT_OLE2 with webutil (instead of OLE2) its get compile successfully but during runtime it give error "oracle.forms.webutil.ole.OleFunctions bean not "found.CLIENT_OLE2.create_obj will not work"
    *so please tell me without oracle application server is this possible or not .*

    your webutil on server side is not configured
    you need to re install the webutil jacob.dll files etc. then it will work fine..
    you can also generate excel file using reports to change the destination format in SPREADSHEET

  • Generate Excel Output

    Hi All!
    I would very much appreciate if you could send me the code for generating Excel output.
    Thanks,
    Waqas
    [email protected]

    Hi,
    Here's the code for generating the excel output, you can write this in button press of form which calls the excel report.It automatically opens a new excel sheet , and then it executes the SQL query, after that each rows will get filled with the values.
    First of all you need to makeall the queries in the report in to a single query.
    declare
         application CLIENT_OLE2.obj_type;
         workbooks CLIENT_OLE2.obj_type;
         workbook CLIENT_OLE2.obj_type;
         worksheets CLIENT_OLE2.obj_type;
         worksheet CLIENT_OLE2.obj_type;
         cell CLIENT_OLE2.obj_type;
         args CLIENT_OLE2.list_type;
         rowcount integer;
         i integer;
         cursor c2 is select 1 from dual;
         cursor c1 is /* write your select query that fetches the required values */
    begin
    application := CLIENT_OLE2.create_obj('Excel.Application');
    CLIENT_OLE2.set_property(application,'Visible','True');
    workbooks := CLIENT_OLE2.get_obj_property (application,'Workbooks');
    workbook := CLIENT_OLE2.invoke_obj(workbooks,'Add');
    worksheets := CLIENT_OLE2.get_obj_property (workbook,'Worksheets');
    worksheet := CLIENT_OLE2.invoke_obj(worksheets,'Add');
    rowcount := 0;i:=1;
    for rec1 in c2 loop
    rowcount := rowcount + 1;
    -- For the headings
    args := CLIENT_OLE2.create_arglist;
    CLIENT_OLE2.add_arg(args,rowcount);
    CLIENT_OLE2.add_arg(args,1);
    cell := CLIENT_OLE2.get_obj_property(worksheet,'Cells',args);
    CLIENT_OLE2.destroy_arglist(args);
    CLIENT_OLE2.set_property(cell,'Value','Column 1 Heading');
    CLIENT_OLE2.release_obj(cell);
    args := CLIENT_OLE2.create_arglist;
    CLIENT_OLE2.add_arg(args,rowcount);
    CLIENT_OLE2.add_arg(args,2);
    cell := CLIENT_OLE2.get_obj_property(worksheet,'Cells',args);
    CLIENT_OLE2.destroy_arglist(args);
    CLIENT_OLE2.set_property(cell,'Value','Column2 Heading');
    CLIENT_OLE2.release_obj(cell);
    end loop;
    for rec1 in c1 loop
    rowcount := rowcount + 1;
    args := CLIENT_OLE2.create_arglist;
    CLIENT_OLE2.add_arg(args,rowcount);
    CLIENT_OLE2.add_arg(args,1);
    cell := CLIENT_OLE2.get_obj_property(worksheet,'Cells',args);
    CLIENT_OLE2.destroy_arglist(args);
    CLIENT_OLE2.set_property(cell,'Value',rec1.field1);
    CLIENT_OLE2.release_obj(cell);
    /*null value may create problems,then use the if condition as follows*/
    args := CLIENT_OLE2.create_arglist;
    CLIENT_OLE2.add_arg(args,rowcount);
    CLIENT_OLE2.add_arg(args,14);
    cell := CLIENT_OLE2.get_obj_property(worksheet,'Cells',args);
    CLIENT_OLE2.destroy_arglist(args);
    IF rec1.field2 IS NOT NULL THEN
    CLIENT_OLE2.set_property(cell,'Value',rec1.field2);
    ELSE
         CLIENT_OLE2.set_property(cell,'Value',' ');
    END IF;
    CLIENT_OLE2.release_obj(cell);
    end loop;
    CLIENT_OLE2.release_obj(worksheet);
    CLIENT_OLE2.release_obj(worksheets);
    CLIENT_OLE2.release_obj(workbook);
    CLIENT_OLE2.release_obj(workbooks);
    CLIENT_OLE2.release_obj(application);
    EXCEPTION WHEN OTHERS THEN
         MESSAGE(SQLCODE||' - '||SQLERRM); MESSAGE(' ');
    end;
    Hope this helps .
    Regards,
    Nycy

  • XML Publisher to generate Excel reports

    Can we use RTF template to generate Excel reports? Is all the process the same or do I need to do some additional set ups? Also, can I create a custom report , set the output format to xml and run XML Publisher on the top of it to generate output of my choice? HAs anybody tried this? or is it possible only in standard reports?
    Pl help. This is v urgent , i need to design my process flow accordingly
    Thanks much

    Hi
    Yes you can generate Excel from an RTF template - there are some limitations. The Excel in this case is not binary Excel - its XHTML and the mime type is set so that Excel opens it.
    So, you can not embed formulae, macros, etc in the RTF template and get the Excel output to execute them.
    You second question is what Publisher is all about, give it XML data and a layout of your choice and then pick the output format you want.
    Tim

  • Error while generating excel report on citrix Metaframe

    Hi All,
    I have developed a form which generates excel on client server. At my work people are using citrix metaframe and when i try to open the same form on the citrix the host command does not work. Can any one help me with this issue.
    currently the host looks like this
    HOST('C:\Program Files\Microsoft Office\Office\EXCEL.EXE c:\sgir938.xls');
    Regards,
    Ritesh

    Is anyone having any idea about it...

Maybe you are looking for

  • Wrong photo in album

    Two questions, please... I'm presenting a slide show tomorrow using iPhoto 4. I created an album of some 100 images. All the thumbnails are correct and in the right order. Yet when I play the slide show, two images are different than the thumbnails!

  • Why cant i open my itunes

    my itunes wont open what can i do

  • Struts, Best proctices to show data from database in view

    Hi, I am using Struts. I need to show a result of select operation, some 50-60 records like a grid. Best method to transfer ResultSet data to View(jsp) from the Action's execute method. Is it a right way to use a collection of objects, that contains

  • Creative Suite 5.5 Design Standard Student and teacher edition-Reinstall

    I need to know where to go on the Adobe site to re install the above titled software. When I download and try to install the software  it will not allow me to fill in the serial number. It shows the space but it will not allow me to enter my serial n

  • Materials Management

    Hey, I would like your help with the following questions. 1. Which table and which field do I need in order to see the time (in days) that passed from the moment I order goods until the goods were received. 2. Which table and which field do I need in