Export HTML table inside JSP to Excel using Java  
Author Message
Jimmy





PostPosted: 2007-6-21 1:52:00 Top

java-programmer, Export HTML table inside JSP to Excel using Java 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

 
Dhananjay





PostPosted: 2007-6-21 13:50:00 Top

java-programmer >> Export HTML table inside JSP to Excel using Java On Jun 20, 10:51 pm, Jimmy <email***@***.com> 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

 
Jimmy





PostPosted: 2007-6-21 21:36:00 Top

java-programmer >> Export HTML table inside JSP to Excel using Java 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