Export HTML table inside JSP to Excel using Java

Discussion in 'Java' started by Jimmy, Jun 20, 2007.

  1. Jimmy

    Jimmy Guest

    When I generate this table inside this JSP page, it will offer a
    button for user to click if he/she decides to export the HTML table
    into an Excel sheet (which get displayed directly back in the
    browser), then user can save his/her this Excel spreadsheet into his/
    her local file system.

    Can someone help me on how I can convert this HTML table to Excel
    using XSLT? Sample code would really help also, if there's any URL to
    refer me to.

    Is it a good idea to generate the Excel file (as temporary file which
    to be sent back to browser later if user click the button) at the same
    time when the HTML table get generated? Then remove this temporary
    Excel file later.

    Any comments? Thanks,
    Jimmy
    Jimmy, Jun 20, 2007
    #1
    1. Advertising

  2. Jimmy

    Dhananjay Guest

    On Jun 20, 10:51 pm, Jimmy <> wrote:
    > When I generate this table inside this JSP page, it will offer a
    > button for user to click if he/she decides to export the HTML table
    > into an Excel sheet (which get displayed directly back in the
    > browser), then user can save his/her this Excel spreadsheet into his/
    > her local file system.
    >
    > Can someone help me on how I can convert this HTML table to Excel
    > using XSLT? Sample code would really help also, if there's any URL to
    > refer me to.
    >
    > Is it a good idea to generate the Excel file (as temporary file which
    > to be sent back to browser later if user click the button) at the same
    > time when the HTML table get generated? Then remove this temporary
    > Excel file later.
    >
    > Any comments? Thanks,
    > Jimmy


    A simple trick worked for me..

    Click on the link "Export to excel"

    and forward the user to new JSP and recreate the table using HTML and
    make sure that contentType of that page is set to "application/vnd-
    msexcel"

    Reagrds'
    Dhananjay
    Dhananjay, Jun 21, 2007
    #2
    1. Advertising

  3. Jimmy

    Jimmy Guest

    Thanks it works but the excel sheet opens up in a separate MS-Excel
    app's window. How can I have this excel sheet open-up/view inside the
    web browser (i.e. IE or Firefox)? Or even open-up/view this excel
    sheet inside a frame of a browser?

    Thanks again,
    Jimmy
    Jimmy, Jun 21, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U3JpZGhhcg==?=

    using Microsoft Excel image for Export to Excel button

    =?Utf-8?B?U3JpZGhhcg==?=, Dec 9, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    3,078
    =?Utf-8?B?U3JpZGhhcg==?=
    Dec 9, 2005
  2. DigitalUncle
    Replies:
    0
    Views:
    885
    DigitalUncle
    Nov 2, 2004
  3. Chicagoboy27
    Replies:
    0
    Views:
    694
    Chicagoboy27
    Dec 4, 2006
  4. Grey
    Replies:
    4
    Views:
    1,937
    Mark Rae [MVP]
    Oct 17, 2007
  5. Shailesh Patel

    export Html table to excel file

    Shailesh Patel, Jan 15, 2008, in forum: ASP .Net
    Replies:
    3
    Views:
    8,676
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Jan 16, 2008
Loading...

Share This Page