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.

Similar Messages

  • 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

  • Generating Excell Sheet using Reports 9i

    Hello,
    I wanna know how can I do to generate one excell sheet using reports, without
    use the option that4s generate text file using tab. I wanna know if someone have
    example codes, or library4s.
    Thanks,
    Paulo Sergio

    Here are some notes we created from the demo below. This works great for generating true formated excel output in 9i Reports using 9ias Rel2.
    Notes from
    http://otn.oracle.com/products/reports/htdocs/getstart/demonstrations/index.html
    Output to Excel with Oracle9i Report
    1.     Create an Excel template for the report. It should contain generic information such as title, logo and column headers
    2.     Cretae a sample line of data in the spreadsheet
    3.     Save the Excel spreadsheet as a Web page. File | Save As Web Page
    4.     Open the Web page you just created in Reports Builder
    5.     Double-click on Web Source node to display the HTML code for the Excel spreadsheet
    6.     Note how Excel generated HTML and XML code for the spreadsheet you created. Reports Builder also adds its own JSP tags
    7.     Add the Data Source An SQL Query
    8.     Modify the Web Source. Now that youve written the query, you can modify the Web source to tell Reports Builder to display your report in Excel.
    9.     Click on the Web Source icon in the toolbar.
    10.     To force the browser to open MS Excel it is necessary to change the HTTP Content Type to a specific MIME Type:
    application/vnd.ms-excel
         Insert the following line immediately before the <rw:report id=report> tag
              <%@ page contentType=application/vnd.ms-excel %>
         (This is a standard JSP directive to set a MIME Type (Content Type) )
    11.     To respect Excel format, you should delete the blank lines above the <html> tag.
    12.     Now, use Oracle 9i Reports JSP tags to add the data retrieved by your SQL Query to the report.
    13.     Search for the sample line of data you added to your Excel spreadsheet
    14.     Each line is saved as an HTML Table Row tag ( <tr> ).
    15.     Each column is mapped as an HTML Table Data tag ( <td> ).
    16.     Using Reports JSP Tags, add a Reports repeating frame tag to loop around the Data Model group.
    17.     To help, show the Object navigator next to the Web Source Window. All group information is now visible in the Object Navigator
    18.     Enclose the sample line of code in the Web source with the Reports9i JSP repeating tag.
    Use from menu Insert | Repeating Frame at beginning of sample
    Move the closing repeating tag after the </tr> tag.
    Start of the repeating tag would be
    <rw:foreach id=foreach src=>
    Ending of the repeating frame would be
    </rw:foreach>
    19.     In the opening of the repeating tag (<for each>), add the name of the group the tags enclose. JSP custom tags require a unique identifier.
    For example: <rw:foreach id=gEmpNoId src=G_EMPNO>
    20.     Now, map the cells of the Excel spreadsheet to the corresponding field from your data model.
    Select on the data value. From menu select Insert | Field. The source of the tag is the name of the field in the query.
    21.     Repeat the operation for each field of the report. Note: do not forget to specify a unique identifier for each field.
    22.     The code now contains a repeating frame. You have also mapped each cell in the Excel spreadsheet to the corresponding field in the data model
    23.     Save the report as a Reports JSP. You can test the report using the Run Web Layout icon in the toolbar
    24.     The execution of a Web Layout report from Reports Builder creates a temporary HTML file and launches the browser. The browser does not launch Excel because the document is saved as an HTML file. To launch Excel from the browser you need to test it from Reports Server.
    25.     In order to have the report appear inside Excel, you need to execute it with the Reports Server under OC4J. To do this you need to:
    First, start an OC4J instance from Oracle 9iDS see How to Execute Reports Services from Oracle 9iDS on OTN. Then, copy the JSP to a directory. For example: $IDS_HOME/reports/j2ee/reports_ids/web/test
    26.     Enter the URL to execute the jsp. The JSP is executed from an OC4J instance.
    http://reports9iTestServer:8888/reports/test/ListOfEmployees.jsp?userid=scott/tiger@ora901
    27. The browser launches Microsoft Excel and displays the data from your report.

  • 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();

  • How do I enable the button to use the tree list in excel? (Enable the list type: Tree enabled in Office 2013 - VSTF 2013)

    Hi, I was looking to see if anyone knows how I can troubleshoot my connection problem with TFS view in excel. I'm trying to  produce a tree view in Office 2013 as described in the following KB -
    https://msdn.microsoft.com/en-us/library/dd286627.aspx
    I have followed the instructions on the KB all the way up to : 'Add backlog items and tasks and their parent-child links using a tree list' and at this point I can't seem to get it to work as the button is greyed out.
    Note that I have completed steps 1-6 for the previous procedure... all 6 steps work just fine. However on step 2 of the second procedure - the instructions state I should be able to 'Add Tree Level' - However the button is greyed out.
    Anyone know what I need to do to enable the button to use the tree list in excel? 
    Frank

    Frank,
    I believe your issue is that you have opened a Flat query and are trying to add tree levels. A flat query is just that and you cannot change the query type from Excel.
    The second process is managing a backlog (which is a tree). TFS web access has a link on the backlog view to create a query. That query will be a "tree of work items" query that returns the items in the backlog including their parent-child relationships.
    This type of query supports the Add Tree Level and Add Child functionality as does a new Input List (not bound to an existing query).
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

  • IMac desktop using OS X Lion.  When I type figures in a table in my email.  They look straight but when I sent it, they look crooked.  How to prevent it?  Do I need to pre-type it on excel and copy and paste it on my email. It takes time and troublesome.

    iMac desktop using OS X Lion.  When I type figures in a table in my email.  They look straight but when I sent it, they look crooked.  How to prevent it?  Do I need to pre-type it on excel and copy and paste it in my email but it takes time and troublesome. 

    Send the table as an attachment, either a spreadsheet (if the recipient needs to be able to edit it) or a PDF.

  • Goods Receipt generates inspection lot using inspection type 08

    Hi,
    I have two plants A and B. I have set up my materials with an 08 inspection type plant B. Material transfers from plant A and B generate an inspection lot using inspection type 08 and inspection lot origin 08. This works perfectly.
    However if I use a stock transfer between two storage locations within 1 plant, using stock transfer order, inspection lot is generated using inspection type 08 when GR is performed.
    Is there a link between 08 inspection type and 101 movement
    Regards

    Yes ,101 & 08 are associated with each other for stock transfer order that is only when receipt indicator is "X" and mvt indicator is prchase order.
    If you do not want this to haapen then
    copy mvt type 101 as Z01 & for this mvt type deactivate QM in
    QCC3->inspection lot creation->Inspect for goods mvt->Deactivate Quality Inspection for a Movement Type>Z01-->deactivate
    Use this mvt type when you are tranferring material from storage location to storage Location.
    This will not create any inspection lot.
    Edited by: Sujit Gujar on Aug 4, 2011 1:09 PM

  • 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

  • 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

  • Webutil error while generate excel form

    Hi
    In my forms appl. I use webutil in order to generate excel reports
    I have to midtier instances both running on a separate host.
    End users connect through a WLB frontend.
    At one of the midtiers, when generating a excel report using webutil "error while running kit"
    No errors appear in any log on the midtier. On a log table in the database ORA-12703 appears but I'm not sure if thats related.
    On the other midtier, with the same compiled forms using the same database it works fine.
    Does anyone have a clue?
    reg.
    Michel

    Hi
    Are you talking about adobe forms or smartforms. These are 2 different types of forms. For Adobe forms you need an ADS which sits on the java stack and needs to be configured properly. Some services need to be activated in SICF for the configuration as well. A conplete guide on how to configure the ADS is found on the following link
    [https://www.sdn.sap.com/irj/sdn/adobe?rid=/webcontent/uuid/90355269-4d89-2a10-0bb9-f388704f1dcd]
    Regards
    Thashin

  • Generate excel sheet list file through program

    Hi,
    I have to generate list in excel which is having column with fixed length.
    I m using classical report for output then in output i m generating excel file .
    but that file is not with fixed column length.
    how ALV will be useful in this case
    Please help.
    Regards,
    Sudhir Ghag.

    Hi,
    As from Ur query u required the output in the fixed length of columns as output in the excel. This is not possible by using Type pool ole2. We have to control the length of the excel cell as fixed.
    Hope this will help U

  • Generating excel 97 files

    Hey everyone,
    It has come to my attention that my coldfusion generated
    excel files will display correctly in excel 2003 but not in excel
    97. When opened in excel 97 html and java script code is displayed.
    When opened up in microsoft's excel 97 viewer I get this error
    message: "Microsoft excel viewer can not open this type of file".
    Any suggestions?

    It all matters how you program the actual template that
    generates the output for Excel, not the file definition - the file
    definition just tells CF what to put in the header.
    Every version of Excel is different in how it works with
    data, and the template you use to generate files that work in Excel
    2003 will likely not work in Excel 97 or even 2000 for that matter.
    You may also find that they don't work in Excel 2007 since the new
    Office runs under MS's version of XML now.
    It would likely be more helpful to see the contents of
    "completeAgentReport.cfm" than the header, since that's where the
    issues will be. Also, please note any error you get in Excel 97
    when you try to open the files.
    **BTW, the reaction from the forums is not unfounded - Office
    97 is an archived/shelved platform product now and does not even
    have support options through MS any longer ... 2000 will be shelved
    this winter as well. You can't always provide output for everyone
    and in most cases developers (while they try to do the best they
    can) can only provide support for the most common.used products.
    Companies that are using Office have pretty much all evolved to
    2003 by now, with a good chunk adopting 2007 as well.

  • The content type for office excel 2007 in jsp page and the mime-type in  we

    Hi,
    In my system MS Office 2007 is installed. I am trying to generating excel sheets from JSP page by setting the content type "application/vnd.ms-excel" in jsp page and as well as in web.xml file. I am getting the below message
    The file you are trying to open, 'xxxxxxxx.xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?
    Then finally the excel file is opening and displaying properly. If in my system MS Office 2003 is installed , then the above message is not coming.
    I have changed the content type according to Excel 2007 <%@ page contentType= "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" %> and in web.xml file the mime type to
    <mime-mapping>
    <extension>xlsx</extension>
    <mime-type>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</mime-type>
    </mime-mapping>
    even the content type is changed according to office excel 2007 , i am getting the same above message.
    My client is asking not to display the above message. So how to prevent that message ?
    It's very great if any body reply me as soon as possible.

    Hi Akash,
    I am not using the POI. I am generating the excel sheet using the below code.
    <jsp:directive.page import="java.util.Map" />
    <jsp:directive.page import="lehman.ra.Report.ReportDefinition" />
    <jsp:directive.page import="lehman.ra.RAUtilBean" />
    <jsp:directive.page import="java.util.ArrayList" />
    <jsp:directive.page import="lehman.util.GeneralUtil" />
    <jsp:directive.page import="lehman.admin.report.AdminHtmlReportFormatter"/>
    <jsp:directive.page import="lehman.helper.irprod.IRProdHelper"/>
    <%@ page contentType= "application/vnd.ms-excel" %>
    <jsp:directive.page import="java.util.Iterator"/>
    <jsp:directive.page import="java.util.HashMap"/>
    <%
         String strTradeDate = (String) session.getAttribute("TradingDate");
         String sContextPath = request.getContextPath();
         IRProdHelper irHelper     = new IRProdHelper();
         String  sReportFormat  = "E2E";     
         String subtab1 = request.getParameter("subtab1");
         if (subtab1 == null)
              subtab1 ="";     
         Map report_Ids    = (Map) session.getAttribute("ADMIN_E2E_REPORTS");
         AdminHtmlReportFormatter formatter = new AdminHtmlReportFormatter();
         ArrayList contentData = new ArrayList();
         ArrayList headerData  = new ArrayList();
         ArrayList metaData    = new ArrayList();
         Map resultMap            = null;
         String headerString       = "";
         String contentString  = "";
         String reportId            = "";
         int titleSpan         = 5;     
         if( report_Ids!=null && report_Ids.size() > 0){
              Object oReportObj      = null;
              Iterator rowIter = report_Ids.keySet().iterator();
              RAUtilBean raUtilBean = new RAUtilBean();
              ReportDefinition rdef = new ReportDefinition();
              while ( rowIter.hasNext() ){          
                   oReportObj = rowIter.next();     
                   reportId = oReportObj.toString();
                   System.out.println("**************reportId="+reportId);     
                   resultMap  =  (HashMap) report_Ids.get(oReportObj);
                   if(resultMap == null )
                        continue;
                   if(resultMap.size() > 0 ) {
                        contentData          = (ArrayList)resultMap.get(GeneralUtil.CONTENT_DATA);
                        headerData          = (ArrayList)resultMap.get(GeneralUtil.COL_METADATA);
                        metaData          = (ArrayList)resultMap.get(GeneralUtil.METADATA);
                        rdef = new ReportDefinition();                    
                        raUtilBean.setReportAttributes(rdef, headerData, metaData,reportId, sReportFormat);
                        titleSpan = raUtilBean.findMaxCol(contentData, rdef.getDisplayCols());
                        if("51031".equals(reportId)){                         
                             if(resultMap.get("HIDE_ETA")!=null){
                                  boolean hideETA = ((Boolean)resultMap.get("HIDE_ETA")).booleanValue();                              
                                  formatter.setHideETA(hideETA);
                                  if(hideETA){
                                       titleSpan = titleSpan-1;
                        rdef.setMaxCol(titleSpan);
                        headerString = formatter.constructHeadingForE2E(rdef, headerData);
                        contentString = formatter.constructContentForE2E(rdef, contentData, strTradeDate, sReportFormat);
    %>     
    <html xmlns:o="urn:schemas-microsoft-com:office:office"
         xmlns:x="urn:schemas-microsoft-com:office:excel"
         xmlns="http://www.w3.org/TR/REC-html40">
         <head>
         <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
         <meta name="ProgId" content="Excel.Sheet"/>
         <meta name="Generator" content="Microsoft Excel 9"/>
         <link rel="File-List" href="./Test33_files/filelist.xml"/>
         <link rel="Edit-Time-Data" href="./Test33_files/editdata.mso"/>
         <link rel="OLE-Object-Data" href="./Test33_files/oledata.mso"/>
         <link href="<%=sContextPath %>/llehman.css" rel="stylesheet" type="text/css">
         <link href="<%=sContextPath %>/llcontent.css" rel="stylesheet" type="text/css">
         <style>
         <xsl:comment>
         table
              {mso-displayed-decimal-separator:"\.";
              mso-displayed-thousand-separator:"\,";}
         .style0
              {mso-number-format:General;
              text-align:general;
              vertical-align:bottom;
              white-space:nowrap;
              mso-rotate:0;
              mso-background-source:auto;
              mso-pattern:auto;
              color:windowtext;
              font-size:10.0pt;
              font-weight:400;
              font-style:normal;
              text-decoration:none;
              font-family:Arial;
              mso-generic-font-family:auto;
              mso-font-charset:0;
              border:none;
              mso-protection:locked visible;
              mso-style-name:Normal;
              mso-style-id:0;}
         .xl21
         {mso-style-parent:style0;
         color:black;
         font-size:8.0pt;
         font-family:Arial, sans-serif;
         mso-font-charset:0;
         border-top:.5pt solid silver;
         border-right:.5pt solid silver;
         border-bottom:.5pt solid silver;
         border-left:none;}
         .xl24
              {mso-style-parent:style0;
              mso-number-format:"\#\,\#\#0\.00_\)\;\\\(\#\,\#\#0\.00\\\)";}
         .xl25
              {mso-style-parent:style0;
              mso-number-format:0%;}
         .xl26
              {mso-style-parent:style0;
              mso-number-format:"\#\,\#\#0_\)\;\\\(\#\,\#\#0\\\)";}
         .xl27
         {mso-style-parent:style0;
         background-color:#666666;
         color:#FFFFFF;
         font-size:9.0pt;     
         font-family:Arial, sans-serif;
         mso-font-charset:0;
         text-align:left;
         vertical-align:middle;
         border-top:none;
         border-right:.5 pt solid silver;
         border-bottom:.5pt  silver;
         border-left:none;
         mso-pattern:auto none;
         white-space:normal;
         .xl55
         color:black;
         font-size:8.0pt;
         font-weight:700;
         mso-style-parent:style0;
         mso-number-format:"\#\,\#\#0_\)\;\[Red\]\\\(\#\,\#\#0\\\)";
         mso-pattern:auto none;
         font-size:9.0pt;
         font-family:Arial, sans-serif;
         mso-font-charset:0;
         text-align:right;
         border-top:none;
         border-right:.5pt solid silver;
         border-bottom:.5pt solid silver;
         border-left:none;
         .xlDate{
         mso-style-parent:style0;
         mso-number-format:"yyyy\\-mm\\-dd";
         .xlDateTime{
         mso-style-parent:style0;
         mso-number-format:"yyyy\\-mm\\-dd\\ h\\:mm\\ AM\/PM";
         </xsl:comment>
         </style>
         <xml>
          <x:ExcelWorkbook>
           <x:ExcelWorksheets>
            <x:ExcelWorksheet>
              <x:Name><%=subtab1%></x:Name>
              <x:WorksheetOptions>
               <x:ProtectContents>False</x:ProtectContents>
               <x:ProtectObjects>False</x:ProtectObjects>
               <x:ProtectScenarios>False</x:ProtectScenarios>
              </x:WorksheetOptions>
            </x:ExcelWorksheet>
           </x:ExcelWorksheets>
          </x:ExcelWorkbook>
          </xml>
         </head>
    <body text="#000000" style="margin-left:5px;margin-top:5px">
          <table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tr>
                  <td>
                       <table  border='0' cellpadding="0"  cellspacing='0' width="100%">
                             <tr class="xl21">
                                  <td align="left" nowrap style='font-size:11px;' colspan="<%=titleSpan%>"><b><%=subtab1%></b> -  COB  <%=irHelper.formatDate(strTradeDate)%>  </td>
                                  </tr>
                         </table>
                   </td>
                </tr>
                <tr>
                     <td> </td>
              </tr>
    <!-- Report Processing -->
              <tr>
                   <td>
                        <%=headerString%>
                        <%=contentString%>
                   </td>
              </tr>
    <%
                   }//end of if
              }//end of while
         }//end of if report_Ids     
    %>          
         </table>
    </body>
    </html>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Date formatting issue in Generated Excel

    Hi All,
    I'm generating a report by getting the values from the query and looping over it.
    This is my code.
    <cfheader name="Content-Disposition" value="inline; filename=testReport.csv">
            <cfcontent type="text/x-excel-csv"><cfoutput><cfloop index="i" list="#columnstrings#">"#i#",</cfloop></cfoutput>
            <cfoutput QUERY="downloadquery">#chr(13)#<cfloop index="i" list="#columnstrings#">"#replace(evaluate('#i#'),'"',"'","ALL")#",</cfloop></cfoutput>
    All the columns are coming perfectly, but the date column is showing 0:00:00 in the generated excel.
    The user has to do a manual formatting for the date columns.
    We are using coldfusion 9 and Oracle 10G
    Any help would be appreciated.
    When i check the dump the query, the date columns are coming correctly.
    Only the excel does not know that its a date column.

    Try prepending an apostrophe.

Maybe you are looking for

  • .ics (iCalendar) file as correspondance for TEM

    Hi guys, Has anyone tried to generate and send .ics (iCalendar) files as an email using the correspondence option on training and event management? I'd appreciate some help with that. Thanks, Ale

  • Note of credit (return) with MIRO during use of two currencies (changeover)

    Hello: We have a problem with the MIRO when we do a second partial note of credit with the new currency VEF (the purchase is in VEB) Now provisionally we work with two currencys: VEB (local currency) and VEF (transaction currency). When there is real

  • Problem in main.m file, SIGABRT !

    Hey! Run in to some confusing problems in my project, SIGABRT ?! The program received signal SIGABRT? Debugger shows that the problem was in the following main.m file: #import <UIKit/UIKit.h> int main(int argc, char *argv[]) { NSAutoreleasePool * poo

  • Commands/Import, Import from an SD card

    I want to import directly from my SD card. I can't do that if I go File/Import/Files, which would seem to be the place to go. Instead, I find hidden under the Final Cut Pro menu/Commands/Import and that works. That seems awful strange to hide it ther

  • Sum of UDF field

    Hi there, I created a UDF for handling the batch of the item, this UDF is the gross weight of the goods. Now what I want to do is when the user pick-up the goods from the Batch form at the bottom there is the sum of the quantity I would have the same