Formatting Excel Cells from JSP

Hello,
I am outputting my resultset in excel. However, in the excel the cells are in a wrapped format. I was wondering if there is a way of changing the cell properties from the jsp itself so that it doesnt wrap. Below is my code snippet I use to ouput to excel.
<%
     String error_date = request.getParameter("error_date");
     File filepath=new File("file.xls");
     response.setContentType("application/vnd.ms-excel");
     response.setHeader("Content-Disposition","inline; filename=" + filepath);
     response.setHeader("cache-control", "max-age=0");
%>
Anything I can do with the setHeader method or something that would enable me achieve my goal would be greatly appreciated.
Thanks a lot All

No, you would have to generate the file right in the first place rather than hoping JSP would have a tool to fix it up. Fact is, JSP doesn't know or care anything about Excel. It isn't even a good idea to use JSP to output Excel data.
Edit: And no, there aren't any HTTP headers to fix up your Excel either. HTTP doesn't know or care anything about Excel either.
Message was edited by:
DrClap

Similar Messages

  • Convert contents of a formatted excel cell to HTML format

    Hi All,
    Background: I am writing a script that uploads some test cases written in excel into Quality Center. For those who are familiar with the QC Excel Addin, this script would do a pretty similar job except for reducing
    the steps involved. I'm using Office 2007 running on Win 7 Pro.
    Need: I have a situation where the contents of a formatted excel cell need to be converted to HTML tags representing the same formattin in the excel cell. For example a cell containg the text: "Verify
    if help topics in Macro section are
    hyperlinked" should be converted to
    <html><b>Verify</b> if help topics in <u>Macro section</u> are <i>hyperlinked</i></html> 
    Question: Is there an inbuilt function in Excel/VBAn accomplish this? Or is a macro required? Any other ideas to accomplish this?
    Note: Whatever used for converting (an inbuilt function or a macro) should support new line characters and colors.
    Any help or redirection to solutions is appreciated.
    Thanks, John.
    --Thanks, John Jacob Tharakan

    Here is the function I wrote. This handles the conversion character by character.
    Function fnConvert2HTML(myCell As Range) As String
    Dim bldTagOn, itlTagOn, ulnTagOn, colTagOn As Boolean
    Dim i, chrCount As Integer
    Dim chrCol, chrLastCol, htmlTxt As String
    bldTagOn = False
    itlTagOn = False
    ulnTagOn = False
    colTagOn = False
    chrCol = "NONE"
    htmlTxt = "<html>"
    chrCount = myCell.Characters.Count
    For i = 1 To chrCount
    With myCell.Characters(i, 1)
    If (.Font.Color) Then
    chrCol = fnGetCol(.Font.Color)
    If Not colTagOn Then
    htmlTxt = htmlTxt & "<font color=#" & chrCol & ">"
    colTagOn = True
    Else
    If chrCol <> chrLastCol Then htmlTxt = htmlTxt & "</font><font color=#" & chrCol & ">"
    End If
    Else
    chrCol = "NONE"
    If colTagOn Then
    htmlTxt = htmlTxt & "</font>"
    colTagOn = False
    End If
    End If
    chrLastCol = chrCol
    If .Font.Bold = True Then
    If Not bldTagOn Then
    htmlTxt = htmlTxt & "<b>"
    bldTagOn = True
    End If
    Else
    If bldTagOn Then
    htmlTxt = htmlTxt & "</b>"
    bldTagOn = False
    End If
    End If
    If .Font.Italic = True Then
    If Not itlTagOn Then
    htmlTxt = htmlTxt & "<i>"
    itlTagOn = True
    End If
    Else
    If itlTagOn Then
    htmlTxt = htmlTxt & "</i>"
    itlTagOn = False
    End If
    End If
    If .Font.Underline > 0 Then
    If Not ulnTagOn Then
    htmlTxt = htmlTxt & "<u>"
    ulnTagOn = True
    End If
    Else
    If ulnTagOn Then
    htmlTxt = htmlTxt & "</u>"
    ulnTagOn = False
    End If
    End If
    If (Asc(.Text) = 10) Then
    htmlTxt = htmlTxt & "<br>"
    Else
    htmlTxt = htmlTxt & .Text
    End If
    End With
    Next
    If colTagOn Then
    htmlTxt = htmlTxt & "</font>"
    colTagOn = False
    End If
    If bldTagOn Then
    htmlTxt = htmlTxt & "</b>"
    bldTagOn = False
    End If
    If itlTagOn Then
    htmlTxt = htmlTxt & "</i>"
    itlTagOn = False
    End If
    If ulnTagOn Then
    htmlTxt = htmlTxt & "</u>"
    ulnTagOn = False
    End If
    htmlTxt = htmlTxt & "</html>"
    fnConvert2HTML = htmlTxt
    End Function
    Function fnGetCol(strCol As String) As String
    Dim rVal, gVal, bVal As String
    strCol = Right("000000" & Hex(strCol), 6)
    bVal = Left(strCol, 2)
    gVal = Mid(strCol, 3, 2)
    rVal = Right(strCol, 2)
    fnGetCol = rVal & gVal & bVal
    End Function
    --Thanks, John Jacob Tharakan

  • Display excel file from jsp

    hi i am trying to read an excel file from a location on the app server and display it in the browser (ie). the excel file should open up and not display the open/save dialog.
    following is the code that i am using. i am not able to get it to work. getting an illegalstateexception and also i am getting all garbage diplayed in the browser. no excel. kindly help.
    <%@ page import="java.io.*" contentType="application/vnd.ms-excel"%>
    <%@ taglib uri="/WEB-INF/tlds/sapphire.tld" prefix="sapphire" %>
    <%@ taglib uri="/WEB-INF/tlds/c.tld" prefix="c" %>
    <%
    //response.reset();
    //response.setHeader("Pragma", "no-cache");
    //response.setHeader("Cache-Control", "no-cache");
    //response.setDateHeader("Expires", 0L);
    ServletOutputStream so = response.getOutputStream();
    String filename = "C:\\example1.xls";
    String mimetype = "application/vnd.ms-excel";
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    InputStream in = new BufferedInputStream(new FileInputStream(filename));
    byte bytebuff[] = new byte[500];
    for(int lengthread = 0; (lengthread = in.read(bytebuff)) != -1;){
    output.write(bytebuff, 0, lengthread);
    byte data[] = output.toByteArray();
    response.setContentType(mimetype);
    so.write(data);
    in.close();
    so.close();
    %>

    A JSP calls getWriter() by default.
    Every time you have a carriage return outside <% %> it gets written to the writer.
    The Illegal state exception would be because you are getting the outputStream after the writer.
    This is better done in a servlet, but can be done in a JSP, try it with code like this:
    <%@ page import="java.io.*" contentType="application/vnd.ms-excel"
    %><%@ taglib uri="/WEB-INF/tlds/sapphire.tld" prefix="sapphire"
    %><%@ taglib uri="/WEB-INF/tlds/c.tld" prefix="c"
    %><%
    %> Note that there is no text at all outside of the <% %> (not even carriage returns)
    Also, why are you writing to a ByteArrayOutputStream (ie into a memory byte array), and then writing the byte array to the servletoutputstream?
    Just put a buffer around the servlet outputstream and write directly to that.
    ServletOutputStream so = response.getOutputStream();
    BufferedOutputStream output = new ByteArrayOutputStream(so);
    ...

  • Format Excel cell

    Hi,
    I am writing a program that will send out an email with an excel attachment. When I open the excel file, it does show the leading zeros if the value contents only digits. For example. if the plant is '0005' the file displays just '5'. Do you know how to format the cell to text field?
    I am using FM 'SO_DOCUMENT_SEND_API1' for the email sending.
    Thanks,
    Chuong

    Hi,
    If you are using OLE automation to create the excel, you should format the cell like this:
    SET PROPERTY OF cell 'NumberFormat' = '@'.
    Regards,
    Claudiu

  • Read excel cell from pdf

    Hello
    I would like to link a pdf file to an excel file so that I can set some anchor points in the pdf file that will allow the pdf to change the value of these anchor points whenever the cells' values in excel change.
    Is there any way or any software to do this?
    Thanks

    hi,
    well you are saying that your excel file contains the name of the file which is stored at somewhere in your root directory structure?..........if is it so then do you want to store the name of the file which is specified in the excel cell, to oracle database as BLOB or CLOB or you want to read the actual content available in the doc or excel file and then store it to oracle database? please verify........
    this is possible using poi.....visit the apache's website for more information on POI api and downloads.......
    thanks
    shishir

  • Error in Open Excel Files from JSP..it display Eksponen...

    How to set Excel format in JSP? - Error in Eksponen.
    Hi, i have a problem.
    I am using JSP to select data from database and open it as an Excel file.
    It works perfectly, but the problem is,
    when the data is NUMBER (even though in JSP, i declare it as a String), in the Excel file, when the data is more than 10, the data will change to Eksponen value.
    Should be = 982520000324464
    but in Excel is = 9.8252E+14
    Can anybody help?

    Depending on how you are generating the Excel file there are different solutions.
    If you are generating the Excel file using contentType="application/vnd.ms-excel" and HTML tables, then you can use the following attribute on the cell you wish to format:
    <TD style="vnd.ms-excel.numberformat:#,##0;">24.562234</TD>where the #,##0 corresponds to the format you wish to present the data in.

  • Formatting excel generated from PL/SQL

    Hi,
    My requirement is to generate an excel from PL/SQL which i was able to do from the the following code from Sanjeev. I was able to generate an excel but the data in the cells were all in formatted as 'general' i want date to formatted as 'date' and currency as 'currency'.
    I searched further and landed upon the following piece of code
    <Cell><Data ss:Type="DateTime">1928-06-25T00:00:00.000</Data></Cell>
    but even it was not helpful.
    Can anyone help me with this? Can this be achieved?
    Thanks,
    Murali

    Would a simple CSV output file do the job?
    If so just concatenate your output together using commas, somthing like
    select column1||','||column2||','||column3
      from my_tablesaving the results to a file

  • Need formatted EXCEL output, from View Output,Oracle Applications

    To view the report(Normal RDF report,not XML Publisher Report) output in EXCEL, I changed the Profile Options.
    From: System Administrator Responsibility.
    Navigation: Install -> Viewer Options.
    Added the below entry.
    PDF application/vnd.ms-excel Microsoft Excel
    Now when I submit the report, after completing, when clicked to View Output, I can see the list showing Browser and Microsoft Excel.
    I saved the Excel Sheet,but its not formatted. How do I get the formatted Output. As columns are not in proper shape.
    Please do the needful.
    Thanks.

    Hi Abdul;
    Please check below thread's mention metalink note&advice:
    Open Text output of a Report in Excel - Bad format
    Re: Open Text output of a Report in Excel  - Bad format
    Hope it helps
    Regard
    Helios

  • Getting output in excel sheet from jsp file

    Hi,
    I am a new programmer. I am trying to get output in excel sheet by clicking a link on page. I have used that 2 statements
    response.setContentType("application/x-download");
    response.setContentType("application/Octet-Stream");
    response.setHeader("Content- disposition","inline;filename=refdsxresults.xls");
    But it is giving an empty excel sheet. I don't know how to put the data in that sheet which is retrieved by using the query below.
    "select p.port_no,p.block_no,p.slot_no,p.channel_no,p.ref_no,"+
    "p.rr,c.card_type,c.work_or_protect,p.port_status_code,p.tr_id,"+
    "p.dest_rr,p.dest_shelf,p.dest_jack,p.mux,"+
    "sid.work_order_number,sid.pon_a,sid.pon_z,"+
    "sid.circuit_id,sid.account_name,sid.account_no,sid.order_no,sid.item_no,"+
    "sid.a_city_code,sid.z_city_code,p.parent_port_no "+
    "from eon_port p,eon_card c,sonet_item_detail sid "+
    "where p.logical_flag='N' and p.card_no*=c.card_no and "+
    "p.current_path_no*=sid.path_no and sid.action!='DISC' and sid.item_status!='CN' "+
    "and p.equip_no="+equipNumber+
    " order by p.ref_no";
    and also can I use the HTML to get this result in the browser. Could you please give an example. I need it urgently.
    Thanks in advance

    In an earlier post, somebody was saying that you can use regular HTML tables to output an XLS file. I've never tried it, so I don't know it to be true, but give it a look:
    http://forum.java.sun.com/thread.jsp?forum=45&thread=407280&tstart=0&trange=15
    If that doesn't work, you can always return a CSV file (comma seperated values).

  • Open an excel file from jsp

    Hi,
    I want to open an excel file on click of a link in the jsp.
    At present iam using href which i feel is not correct as it is not able to recognize the excel format and paints the entire screen with special characters.Can anyone please help me out.
    Thanks,

    In your server, there should be some way to tell the server the mime type of a file based on the file's extension. So, you tell the server for every file with the extension of .xls, it should use the mime type of application/vnd.ms-excel. Then, when the link is clicked on, the browser will receive the mime-type message of application/vnd.ms-excel and will open Excel to work with the file.
    Hope this helps,
    Ron

  • How can I access Excel spreedSheet from JSP under Unix

    I have Jrun webserver running on Unix. I want to write a JSP application that will open Excel spreedsheet. Please let me know if anyone has done this kind of thing. Thanks.

    Well there can be various solutions if u really wanna try. The best one is as below.
    Ms-Excel has the facility to save an spreadsheet as an HTML page. That solves all ur problems.

  • Sending a formatted Excel sheet as an attachment in a mail.

    Hi ,
    I have been using following code to to send formatted excel sheet as attachment in email.
    in the below code I want to change the format of cell from Bold to Underline.
    I have replaced Bold with Underline for below code but it is not working can anyone suggest on this.
    Department
      r_cell = l_document->create_simple_element( name = 'Cell'  parent = r_row ).
      r_cell->set_attribute_ns( name = 'StyleID'  prefix = 'ss'  value = 'Header' ).
      r_data = l_document->create_simple_element( name = 'Data'  value = 'MATNR'  parent = r_cell ).
      r_data->set_attribute_ns( name = 'Type'  prefix = 'ss' value = 'String' ).
      r_format->set_attribute_ns( name = 'Bold'  prefix = 'ss'  value = '1' ).
    Creating a ixml Factory
      l_ixml = cl_ixml=>create( ).
    Creating the DOM Object Model
      l_document = l_ixml->create_document( ).
    Create Root Node 'Workbook'
      l_element_root  = l_document->create_simple_element( name = 'Workbook'  parent = l_document ).  l_element_root->set_attribute( name = 'xmlns'  value = 'urn:schemas-microsoft-com:office:spreadsheet' ).   ns_attribute = l_document->create_namespace_decl( name = 'ss'  prefix = 'xmlns'  uri = 'urn:schemas-microsoft-com:office:spreadsheet' ).  l_element_root->set_attribute_node( ns_attribute ).   ns_attribute = l_document->create_namespace_decl( name = 'x'  prefix = 'xmlns'  uri = 'urn:schemas-microsoft-com:office:excel' ).  l_element_root->set_attribute_node( ns_attribute ).
    Create node for document properties.
      r_element_properties = l_document->create_simple_element( name = 'TEST_REPORT'  parent = l_element_root ).  l_value = sy-uname.  l_document->create_simple_element( name = 'Author'  value = l_value  parent = r_element_properties  ).
    Styles
      r_styles = l_document->create_simple_element( name = 'Styles'  parent = l_element_root  ).
    Style for Header
      r_style  = l_document->create_simple_element( name = 'Style'   parent = r_styles  ).  r_style->set_attribute_ns( name = 'ID'  prefix = 'ss'  value = 'Header' ).   r_format  = l_document->create_simple_element( name = 'Font'  parent = r_style  ).
    Worksheet
      r_worksheet = l_document->create_simple_element( name = 'Worksheet'  parent = l_element_root ).  r_worksheet->set_attribute_ns( name = 'Name'  prefix = 'ss'  value = 'PO Details' ).
    Table
      r_table = l_document->create_simple_element( name = 'Table'  parent = r_worksheet ).  r_table->set_attribute_ns( name = 'FullColumns'  prefix = 'x'  value = '1' ).  r_table->set_attribute_ns( name = 'FullRows'     prefix = 'x'  value = '1' ).
    Column Formatting
      r_column = l_document->create_simple_element( name = 'Column'  parent = r_table ).  r_column->set_attribute_ns( name = 'Width'  prefix = 'ss'  value = '70' ).   r_column = l_document->create_simple_element( name = 'Column'  parent = r_table ).  r_column->set_attribute_ns( name = 'Width'  prefix = 'ss'  value = '70' ).   r_column = l_document->create_simple_element( name = 'Column'  parent = r_table ).  r_column->set_attribute_ns( name = 'Width'  prefix = 'ss'  value = '70' ).   r_column = l_document->create_simple_element( name = 'Column'  parent = r_table ).  r_column->set_attribute_ns( name = 'Width'  prefix = 'ss'  value = '70' ).   r_column = l_document->create_simple_element( name = 'Column'  parent = r_table ).  r_column->set_attribute_ns( name = 'Width'  prefix = 'ss'  value = '70' ).
    Blank Row
      r_row = l_document->create_simple_element( name = 'Row'  parent = r_table ).
    Column Headers Row
      r_row = l_document->create_simple_element( name = 'Row'  parent = r_table ).  r_row->set_attribute_ns( name = 'AutoFitHeight'  prefix = 'ss'  value = '1' ).
    Sr. No.
      r_cell = l_document->create_simple_element( name = 'Cell'  parent = r_row ).  r_cell->set_attribute_ns( name = 'StyleID'  prefix = 'ss'  value = 'Header' ).  r_data = l_document->create_simple_element( name = 'Data'  value = 'EBELN'  parent = r_cell ).  r_data->set_attribute_ns( name = 'Type'  prefix = 'ss' value = 'String' ).
    User Name
      r_cell = l_document->create_simple_element( name = 'Cell'  parent = r_row ).  r_cell->set_attribute_ns( name = 'StyleID'  prefix = 'ss'  value = 'Header' ).  r_data = l_document->create_simple_element( name = 'Data'  value = 'EBELP'  parent = r_cell ).  r_data->set_attribute_ns( name = 'Type'  prefix = 'ss' value = 'String' ).
    Full Name
      r_cell = l_document->create_simple_element( name = 'Cell'  parent = r_row ).  r_cell->set_attribute_ns( name = 'StyleID'  prefix = 'ss'  value = 'Header' ).  r_data = l_document->create_simple_element( name = 'Data'  value = 'AEDAT'  parent = r_cell ).  r_data->set_attribute_ns( name = 'Type'  prefix = 'ss' value = 'String' ).
    Department
      r_cell = l_document->create_simple_element( name = 'Cell'  parent = r_row ).  r_cell->set_attribute_ns( name = 'StyleID'  prefix = 'ss'  value = 'Header' ).  r_data = l_document->create_simple_element( name = 'Data'  value = 'MATNR'  parent = r_cell ).  r_data->set_attribute_ns( name = 'Type'  prefix = 'ss' value = 'String' ).  r_format->set_attribute_ns( name = 'Bold'  prefix = 'ss'  value = '1' ).   r_format  = l_document->create_simple_element( name = 'Interior' parent = r_style  ).  r_format->set_attribute_ns( name = 'Color'   prefix = 'ss'  value = '#C0C0C0' ).  r_format->set_attribute_ns( name = 'Pattern' prefix = 'ss'  value = 'Solid' ).   r_format  = l_document->create_simple_element( name = 'Alignment'  parent = r_style  ).  r_format->set_attribute_ns( name = 'Vertical'  prefix = 'ss'  value = 'Center' ).  r_format->set_attribute_ns( name = 'WrapText'  prefix = 'ss'  value = '1' ).
    Data Table
      LOOP AT it_ekpo INTO wa_ekpo.     r_row = l_document->create_simple_element( name = 'Row'  parent = r_table ).
    Sr. No.
       r_cell = l_document->create_simple_element( name = 'Cell'  parent = r_row ).
       r_cell->set_attribute_ns( name = 'StyleID'  prefix = 'ss'  value = 'Data' ).
       l_value = sy-tabix.
       CONDENSE l_value NO-GAPS.
       r_data = l_document->create_simple_element( name = 'Data'  value = l_value   parent = r_cell ).           " Data
       r_data->set_attribute_ns( name = 'Type'  prefix = 'ss'  value = 'Number' ).                               " Cell format
    EBELN
        r_cell = l_document->create_simple_element( name = 'Cell'  parent = r_row ).    r_cell->set_attribute_ns( name = 'StyleID'  prefix = 'ss'  value = 'Data' ).    l_value = wa_ekpo-ebeln.    r_data = l_document->create_simple_element( name = 'Data'  value = l_value   parent = r_cell ).           " Data    r_data->set_attribute_ns( name = 'Type'  prefix = 'ss'  value = 'String' ).                               " Cell format
    EBELP
        r_cell = l_document->create_simple_element( name = 'Cell'  parent = r_row ).    r_cell->set_attribute_ns( name = 'StyleID'  prefix = 'ss'  value = 'Data' ).    l_value = wa_ekpo-ebelp.    r_data = l_document->create_simple_element( name = 'Data'  value = l_value   parent = r_cell ).           " Data    r_data->set_attribute_ns( name = 'Type'  prefix = 'ss'  value = 'String' ).                               " Cell format
    AEDAT
        r_cell = l_document->create_simple_element( name = 'Cell'  parent = r_row ).    r_cell->set_attribute_ns( name = 'StyleID'  prefix = 'ss'  value = 'Data' ).    l_value = wa_ekpo-aedat.    r_data = l_document->create_simple_element( name = 'Data'  value = l_value   parent = r_cell ).           " Data    r_data->set_attribute_ns( name = 'Type'  prefix = 'ss'  value = 'String' ).                               " Cell format
    MATNR
        r_cell = l_document->create_simple_element( name = 'Cell'  parent = r_row ).    r_cell->set_attribute_ns( name = 'StyleID'  prefix = 'ss'  value = 'Data' ).    l_value = wa_ekpo-matnr.    r_data = l_document->create_simple_element( name = 'Data'  value = l_value   parent = r_cell ).          " Data    r_data->set_attribute_ns( name = 'Type'  prefix = 'ss'  value = 'String' ).                              " Cell format   ENDLOOP.
    Creating a Stream Factory
      l_streamfactory = l_ixml->create_stream_factory( ).
    Connect Internal XML Table to Stream Factory
      l_ostream = l_streamfactory->create_ostream_itable( table = l_xml_table ).
    Rendering the Document
      l_renderer = l_ixml->create_renderer( ostream  = l_ostream  document = l_document ).  l_rc = l_renderer->render( ).
    Saving the XML Document
      l_xml_size = l_ostream->get_num_written_raw( ).
    Before sending the mail,
    LOOP AT l_xml_table INTO wa_xml.
        CLEAR objbin.
        objbin-line = wa_xml-data.
        APPEND objbin to BINARY_CONTENT.
      ENDLOOP.
    Here, objbin is of type SOLIX and BINARY_CONTENT is of type SOLIX_TAB.
    Now, call the method,
    CALL METHOD DOCUMENT->ADD_ATTACHMENT
            EXPORTING  I_ATTACHMENT_TYPE = 'XLS'
                       I_ATTACHMENT_SUBJECT = 'My attachment'
                       I_ATT_CONTENT_HEX    = BINARY_CONTENT   .

    Try this..
      r_format->set_attribute_ns( name = 'Underline'  prefix = 'ss'  value = 'Single' ).

  • 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>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • When i paste some copied color text or formatted cells from excel to my mail draft while composing a mail, it is being pasted as plain text. No back groud or text colors are copied to it. Please suggest a possible solution for this issue.

    Colors & Formatted Cells from Excel application can not be copied to my mail composer as it is. Only Plain text is copied.

    Wish I could be king. But you described the problem perfectly and I am still but a pawn. All I can say is that I trashed the mail preferences (com.apple.mail.plist) on my Mac Mini, and now my MacBook seems to work right.
    Sorry. :>) But that is the truth... The MacBook now has actually sometimes displayed pasted text in its actual, different, font and style as I paste it into a partially composed new mail message.
    In other (more rational) words, the problem seems to be tied to pasting only certain types of text. I have not been able yet to pinpoint what. Yes, frustrating indeed. The only work-around has been to re-train my fingers to command-option-shift V, for "paste and match style" (like you, I do not want to always use only plain text). Maybe someone else will eventually weigh in with a real solution. The solution I want is just to be able to consistently see any font variations within my message before I send the email.
    The info about the different ppi scales between Windows and Mac is interesting, although not relevant to this particular problem. It does explain the apparent overall size differences I have seen before.

  • How to export long formatted text from SAP to an excel Cell

    I have created an object(ZMM_TXT_PD) and an ID(Y01) using se75 transaction.
    With a Z program a store some lines in STXH table with object ZMM_TXT_PD and ID Y01.
    These texts are very long and formmated.
    Now I need another Z program in order to download all the stored texts in an excel file.
    I have a program which is able to download an internal table to an excel. The problem is that
    it only works with short texts. How could I download a long text that I get using READ_TEXT function
    into an excel cell?
    READ_TEXT returns an internal table like this:
       i_tline   TYPE  STANDARD  TABLE  OF tline.
    Thanks in advance.

    Hi,
    Use the following link for exporting formatted data into excel
    http://saptechsolutions.blogspot.com/2012/01/send-email-of-xml-format-data-as-excel.html

Maybe you are looking for

  • F.05 for All GL Acounts including P&L

    Hi! Can we use F.05 to valuate all GL accounts including B/S (not open and not in foreign currency) and all P&L accounts? If so, can the valuation difference be posted to the original account assignments (cost centers or profit centers etc) of the P&

  • Photoshop CC Save for Web Greyed out

    After the last Creative Cloud Photoshop update my Photoshop CC 64 bit save for web is greyed out and I can no longer save as a png. Using Windows 7 How can I correct this. thanks, Buddy

  • Problems with ALV refreshing

    I have a button to refresh an ALV. The first time it does it but the nexts doesn't. I want the ALV to have the last modifications of table pa0000 (HR) when I refresh it instead of having the modifications made before, in the last loop. It seems that

  • What will happen if I don't download ios 7

    What will happen if I don't download ios 7

  • Multiple Aperture Libraries the best way to go?

    Many thanks in advance for your attention. Somewhat new to Aperture and take photos for a living. Last two days took some 500 photos (will probably eventually whittle those down to 20). I have about thirty Projects so far and am thinking I should tur