This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes How do i save a file that has been generated using JSP in excel format . Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How do i save a file that has been generated using JSP in excel format ." Watch "How do i save a file that has been generated using JSP in excel format ." New topic
Author

How do i save a file that has been generated using JSP in excel format .

Prashanth Vijayai
Greenhorn

Joined: Jul 20, 2007
Posts: 17
Im generating report in jsp ,
I have to save this file in excel format . I tried to save this by using the file option that is File ->Save As but it does not provide me to save it in excel format. How can i save it in excel format.

My second question is that im providing a button saying it as "save" where when i press that button the report that i have mention above should save in excel format . How do i code this using Java coding .

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41073
    
  43
JSPs are generally used for generating HTML. If you want to save it to something Excel can make use of, you need to generate CSV or proper XLS files (for which you'd need to use a servlet - JSPs can't create binary content).


Ping & DNS - my free Android networking tools app
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You will need to make a call to the server and have to add these headers to the page

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do i save a file that has been generated using JSP in excel format .
 
Similar Threads
Convertiing HTML to Excel format.
can we export the data from jsp page to a excel sheet with out a database hit
How to Export web page(jsp page) to excel using jsp or servlets
Convert a report in Jsp to PDF format
Download it in different sheets in Excel