Export HTML table inside JSP to Excel using Java

J

Jimmy

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
 
D

Dhananjay

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
 
J

Jimmy

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top