Excel export from html/jsp

Hi,
I have a jsp-file based on data of a DB2. This data should be exported to an excelsheet, starting the application (not browser plug-in).
Thanks for help.
Sien-Lie
[email protected]

Hi,
some solution here :
1. if you've create an Excel file, just set the response content type to 'application/vnd.ms-excel' and send the file data to response.
2. write data to response.out, each document line will be a sheet line, every colum are separate by a tabulation
3. write an HTML TABLE which contains data to response.out
Hope this helps.

Similar Messages

  • Add columns to EXCEL exported from ALV

    Hi,
    I'm using the function module REUSE_ALV_GRID_DISPLAY, to display an ALV report. This report shows a standard text when users click on one column.
    I wanna know if its possible to add the standard text as a column into the EXCEL exported from this ALV? and if so, how can I do it?
    Regards.
    Gregory.

    Thanks again Raymond,
    With internal tables that have a type from ABAP dictionary works fine. My problem is that my internal table is declared into my program's global variables. My code bellow:
    DATA: BEGIN OF it_excel OCCURS 0,
             department  TYPE adcp-department,
             bname       TYPE usr02-bname,
             name_text   TYPE adrp-name_text,
             agr_name    TYPE agr_users-agr_name,
             text        TYPE agr_texts-text,
             from_dat    TYPE agr_users-from_dat,
             to_dat      TYPE agr_users-to_dat,
             tcode       TYPE agr_tcodes-tcode,
             ttext       TYPE tstct-ttext,
             tdesc       TYPE string,
          END OF it_excel.
    * fills the it_excel table
    perform fill_excel_data.
      CALL METHOD cl_gui_frontend_services=>file_save_dialog
        EXPORTING
          window_title         = 'File location'
          file_filter          = cl_gui_frontend_services=>filetype_excel
          prompt_on_overwrite  = 'X'
        CHANGING
          filename             = v_file
          path                 = v_path
          fullpath             = v_fpath
          user_action          = v_useraction
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          not_supported_by_gui = 3
          OTHERS               = 4.
      CHECK sy-subrc EQ 0 AND v_useraction EQ 0.
      CREATE OBJECT v_excel 'EXCEL.APPLICATION'.
      SET PROPERTY OF v_excel 'VISIBLE' = 0.
      CALL METHOD OF v_excel 'WORKBOOKS' = v_workbooks.
      CALL METHOD OF v_workbooks 'ADD'.
      SET PROPERTY OF v_excel 'SHEETSINNEWWORKBOOK' = 1.
      CALL METHOD OF v_excel 'Worksheets' = v_sheet
        EXPORTING #1 = 1.
      CALL METHOD OF v_sheet 'Activate'.
      CLEAR v_subrc.
      CALL METHOD cl_gui_frontend_services=>clipboard_export
        IMPORTING
          data                 = it_excel[]
        CHANGING
          rc                   = v_subrc
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          not_supported_by_gui = 3
          OTHERS               = 4.
      CHECK v_subrc EQ 0.
      GET PROPERTY OF v_excel 'ACTIVESHEET' = v_sheet.
      CALL METHOD OF v_sheet 'PASTE' NO FLUSH.
      CALL METHOD OF v_sheet 'SAVEAS'
        EXPORTING #1 = v_fpath #2 = 1.
    When calling cl_gui_frontend_services=>clipboard_export method the variable v_subrc is equal to 0 and sy-subrc is equal to 1 and the EXCEL file is not saved.
    Can you please tell me, what am I doing wrong?
    Regards,
    Gregory
    Edited by: Gregory Mayorga on Sep 7, 2010 10:56 AM

  • Execution date in Excel export from a query

    Dear all,
    I am wondering if it is possible to have the query execution date in an exported excel.
    Case: When working in a query it should be possible to export the query to excel. However I am missing the execution date of the query and the last successful data load (which is visible in the webquery).
    Anyone has an idea how to achieve that?
    Thank you in advance,
    Andreas

    Hey Guys,
    Just wanted to point out that I know how to do this with a webapplication but I would need that within an excel export from an ordinary web query.
    Could someone help out here?
    Thanks in advance,
    Andreas

  • How to enhance the Excel export from Crystal Reports

    Hello,
    I am new in Crystal Reports and I wonder if it is possible to enhance the Excel export from Crystal Reports with post-processing that would be applied to the Excel exported file.
    By example, is it possible to freeze the window panes, so rows and columns are frozen in place on the screen?
    Is there any possibility to obtain the file exported to excel to work with.
    Or maybe there is some ways to parametrize the Excel export from Crystal Reports?
    Any suggestions are welcomed.

    If you are using Crystal Reports 2008 you can use the Report Application SDK that is now available.
    It has a object called PrintOutputController that has an export method that allows you to get access to the exported file before you send it to the user.
    Check the Developer library and the samples for details.
    <a href="/blog/10">Rob&#39;s blog - http://diamond.businessobjects.com/robhorne</a>

  • Collapsed groupings in Excel export from FR

    I am at a client, they are doing variance reporting. Is there a way coming out that will allow groupings to be exported? For example, their report looks at Current forecast and prior year and then prior year variance. When they initially look at the report the prior year columns are hidden. What they are requesting is to export to excel with the prior year hidden columns collapsed.? Any ideas??
    Thanks!

    Hey Guys,
    Just wanted to point out that I know how to do this with a webapplication but I would need that within an excel export from an ordinary web query.
    Could someone help out here?
    Thanks in advance,
    Andreas

  • How to freeze the columns in excel exported from SSRS report??

    We have created a report for our client. The client wants the report in excel format. As there are nearly about 30,000 rows in the excel. Client wants us to freeze the column header names in the excel so that even after scrolling down they
    will be able to see the column names.
    can anybody have idea how to achieve this in SSRS?

    Hi Shard,
    Thanks for your post, You can achive your requiremets by using the below logic. hope this will help you.
    Steps to achieve it
    1. Select the tabix and click on Tablix properties.
    2. In the General tab under Column Headers section you can see "Keep header visible while scrolling" checkbox, check it.
    3. Now the header row will be remain fixed in the report.
    OR
    1.    In the grouping pane, make sure to turn on advanced mode (click on the small black down arrow on the far right of the grouping pane) 
    2.  Select the corresponding (Static) item in the row group hierarchy
    3.  In the properties grid, set RepeatOnNewPage to true
    4. KeepwithGroup to After
    OR
    1)Freeze the header of all columns[ Freezing table header ] : To do select static member of table header row from  row groups [ Advanced Mode ] and set  FixedData to true
    2) Freeze the initial 2 columns : To do select static member of columns in column group and set fixedData to true .
    How do you freeze the tablix header row in an Excel export file in SSRS 2008
    Suhas Kudekar
    Mark as Answer if this resolves your problem or "Vote as Helpful" if you find it helpful.
    My Blog
    Follow @SuhasKudekar

  • Opening Excel  files from a JSP page

    Hi,
    I am not able to open up an Excel file through JSP.
    I am using following code snippet in JSP page
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition","inline; filename=Test.xls");Do i need to do additional settings for rendering Excel from a JSP
    Thanks in advance !!!

    Hi,
    In my application , we have Excel files on the server i.e we are not creating excel sheets.
    I just want to display these static excel files through a jsp.
    I am able to display the excel files by reading them into ByteArrayOutputStream
    <%
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition","attachment; filename=B.xls");
    ServletOutputStream so = response.getOutputStream();
    String filename = "D:\\Test.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();
    %>But my question is that , do i really need to do all this for rendering excel through a jsp.
    Can't i do it by just setting the content type ?
    Thanks

  • Questions regarding Excel Export from Table

    Hello,
    i've implemented the Excel Export described in this blog:
    /people/sap.user72/blog/2006/05/04/enhancing-tables-in-webdynpro-java-150-custom-built-table-utilities
    It works fine, but i have 2 question:
    - You have to add your Columns who want to get in Excel in the ArrayList. I have a table with LayoutOption (make Columns Visible/Invisible) and want to get all visible columns in my Excel list. You can i realize that?
    - My Excel List is shown in my existing Browser Window, but i want to open a new Window, how can i do that?
    Kind Regards,
    Christopher

    Hello Cristopher,
    For the first Qst:
      Lets think in this way; you have set two column fields invisible and in wdModifyView() check if the columns are visible set a flag and accordingly you can set the header at the getColumnInfo() function.
    Preferably use switch case to check the ArrayList selection and adding values to it.
    For the second Qst:
      Its all about the Browser property; where you have to set the option New window should be opened in new window. This will work.
    +in case of Mozilla; in Tools->option->Tab->new window should be open in
    new window
    new Tab
    +
    Select new window
    Regards
      -Vinod V

  • Exporting from HTML DB 1.4 to 2.0 - "Program too large (Diana nodes)"

    Hi
    I exported an HTML DB 1.4. into a script and got an error while trying to execute it.
    The script itself is over 800 kb and consists of 25 000 lines. However, it is divided into begin-end blocks.
    If I start the script in HTML DB 2.0 I get an error:
    "Program too large (Diana nodes)"

    Sorry, it should have been HTML DB 1.4 <b>application</b>.
    The application causing this problem has also a page with about 200 items, so I hope that after I have splitted this problematic page into multiple pages, this "program too large" problem would also solve.

  • Problem making an Excel file from a jsp

    Hi.
    I'm developing a web application that uses Excel for printing the reports. So far everything has worked fine, at least for the created Excel files that do not have any images on them. Now I need to create an excel file with an image as the header. I tried adding the necessary code to include the image, but when I open it, the image is not displayed (like when you open an HTML page that could load a certain image). I tried using different ways to set the src to see if maybe the path was the problem, but everytime I got the same result...
    How can I do this? How can I include the image and actually display it when the user opens the file in Excel?
    Thanks in advance
    CyberSpider

    I had a similar porblem....
    I got some help from...http://www.javaworld.com/javaworld/jw-10-2006/jw-1019-xmlexcel.html?page=1...
    This is my code in servlet...
    HSSFWorkbook wb = new HSSFWorkbook();
    HSSFSheet spreadSheet = wb.createSheet("Users");
    spreadSheet.setColumnWidth((short) 0, (short) (256 * 25));
    spreadSheet.setColumnWidth((short) 1, (short) (256 * 25));
    // Creating Rows
    HSSFRow row = spreadSheet.createRow(0);
    HSSFCell cell = row.createCell((short) 1);
    cell.setCellValue("Year 2005");
    cell = row.createCell((short) 2);
    cell.setCellValue("Year 2004");
    HSSFRow row1 = spreadSheet.createRow(1);
    HSSFCellStyle cellStyle = wb.createCellStyle();
    cellStyle.setBorderRight(HSSFCellStyle.BORDER_MEDIUM);
    cellStyle.setBorderTop(HSSFCellStyle.BORDER_MEDIUM);
    cellStyle.setBorderLeft(HSSFCellStyle.BORDER_MEDIUM);
    cellStyle.setBorderBottom(HSSFCellStyle.BORDER_MEDIUM);
    cell = row1.createCell((short) 0);
    cell.setCellValue("Revenue ($)");
    cell = row1.createCell((short) 1);
    cell.setCellValue("25656");
    cell = row1.createCell((short) 2);
    cell.setCellValue("15457");
    FileOutputStream output = new FileOutputStream(new File("/tmp/Users.xls"));
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition", "attachment;filename=Users.xls");
    ServletOutputStream out = response.getOutputStream();
    wb.write(output);
    output.flush();
    output.close();
    forward = null;
    In firefox i get the download dialog box but not able to open in from there,i need to save it and then open. In IE i dont get the dialog box instead the excell open inside the browser......Please help me to open a excel sheet onclick on a link "Export to excel" in jsp......
    Thanks in advance...

  • Excel Export from Discoverer doesn't work

    Hello ,
    my customer has problems with exporting excel from discoverer.
    It works until it says 'open excel', then she gets a white screen and nothing happens anymore, after that, she has to shut down the computer, because nothing works anymore.
    And it only happens with a certain discoverer-user.
    Another customer has the same problem with the same discoverer-user.
    I don't have this problem with the same discoverer-user, everything works fine on my computer.
    I don't know what problem this could be, and I don't know, where I must start searching ???
    Can anybody help?
    Thanks Uta

    Hi Uta
    It sounds like you might be Windows XP with Service Pack 2 installed. Microsoft, as always, does not quite tell you everything that they have changed. The big one this time is that Service Pack 2 sets a registry switch that by default prevents Internet Explorer from transferring applications between zones. To Microsoft, running something from a web server (Discoverer) and then running something on your PC (Excel) means running applications in two different zones. With that switch set, your PC cannot switch zones when running Internet Explorer and so cannot open Excel from within Discoverer Plus or Viewer.
    To allow Discoverer Plus to call a local copy of Excel you need to reset the switch so that it one again allows zone switching, like the old XP. The switch should be set to 0.
    Follow this workflow:
    1. Open your registry and look for this setting:
    [HKEY_LOCAL_MACHINE]/Software/Microsoft/Internet Explorer/Main/FeatureControl/FEATURE_ZONE_ELEVATION/iexplore
    It is probably set to 1 and it should be set to 0
    In the Windows environment:
    1. Start | Run | Regedit (to open the registry)
    2. Locate the following key path:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_ZONE_ELEVATION\iexplore.exe
    3. Change the value of this setting from 1 to 0 and close the registry editor
    4. Ensure that the following settings for the .xls & .xlsx file types are unchecked:
    a) Open Windows Explorer
    b) Goto Tools | Folder Options | File Types tab
    c) Select the Extension XLS for Excel 2003 (or XLSX for Excel 2007) then click on the Advanced button
    d) At the botton of the screen are three settings that use checkboxes. If either of the following two are checked, un-check them:
    'Confirm Open after Download' and 'Browse in same window'
    5. Click the OK button
    6. Click the Apply button and close Explorer
    7. Re-boot the PC
    Let me know if this helps
    Best wishes
    Michael

  • Encrypt Excel Export from SQL Server Reporting Services prior to attaching to e-mail

    Does SSRS 2012 have a secure e-mail Delivery Extension that would allow the Excel document to be encrypted?
    Or is there sample code?
    Or is the best approach to consider a Microsoft Partner product such as Database Potential, Inc.'s "Secure Delivery Pack for SQL Server Reporting Services"?
    http://www.databasepotential.com/product-p/sdp.htm
    Thanks in advance for any thoughts or feedback regarding this topic.
    Boyd

    Hi Boyd,
    Currently, it’s not supported a delivery extension that encrypts documents before sending them in Reporting Services. If you have the SQL Server Integration Services (SSIS) environment, you can use the following workaround:
    1. Using SSIS Script Task to encrypt the report before exporting it to the Excel file.
    2. Add a Send Mail Task to send the Excel files to the recipients.
    For the details, please refer to the document below:
    http://microsoft-ssis.blogspot.in/2011/10/encrypt-files-in-ssis.html
    In addition, we can try to use .NET API approach. In this scenario, we need capture the Excel file using the WQL Query of FileWatcher, and then encrypt the file, finally email the Excel File.
    For the details, please refer to the blog as shown below:
    http://microsoft-ssis.blogspot.in/2010/12/continuously-watching-files-with-wmi.html
    If you need more assistance, please feel free to contact me.
    Regards,
    Heidi Duan
    If you have any feedback on our support, please click
    here.
    Heidi Duan
    TechNet Community Support

  • Opening an Excel File using Excel 97 from a JSP populated page(Urgent)

    Hello,
    I am using a JSP Page to populate data from the DB.
    When I am opening the same as an Excel File the JSP code is coming as the Excel page whenever Excel 97 is being used,but when Excel2000 or 2003 is being used then the data are coming as Excel formatted.I used the following code(JSP) :
    <head>
    <%
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition","inline; filename=ExtractData.xls");
    %>
    </head>

    I can't even tell what the difference is between "coming as the Excel page" and "coming as Excel formatted". But then when people make urgent posts they very rarely spend the time to describe the problem accurately. Why bother when it's so damn urgent?

  • Random characters added in Excel export from Adobe Tracker (via fillable PDF from FormsCentral)

    Exported fillable PDF from FormsCentral and distributed it via Adobe Pro X.  Received two responses and from the Tracker, we exported to Excel.  In the Excel columns, there are seemingly random characters and the word "edit" which are not in our question.  For example, "_10_8_House_rep_edit;_6S7OYQDcL9nQcNR6j761WQ
    Thanks!

    1. To edit the PDF follow these steps : http://forums.adobe.com/docs/DOC-3661
    2. The fillers don't need to have a subscription (paid or free) to fill up the form. They can fill out the PDF and save it to their machine and then submit. Only the author of the form needs to have a paid FormsCentral subscription to collect data via PDF forms.

  • Unable to perform Calculations on Excel exported from Web Dynpro ABAP

    Hi Gurus,
    I have a custom functionality "Export to Excel" internal table data on my web dynpro application. I dint go with standard ALV feature because it doesnot give flexibility to add colours to excel sheet and add multiple tabs and so i had to write XML ABAP coding in the web dynpro application to achieve this. While passing the internal table data into cells, i created cells with string data type and hence all the fields in the excel are now in char type. Users are unable to perform any calculations because of this issue, i tried to format the cells but it doesnot work. Please help me.
    Regards,
    Pravs.

    Hi,
    Just do the following in excel before downloading and check whether it works.
    Tools->Options->International tab.
    In that mention decimal separator as ,(comma).
    Thousand separator as .(dot).
    Uncheck use system separators.

Maybe you are looking for