my dog learned polymorphism*
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
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: 42375
    
  64
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
 
 
subject: How do i save a file that has been generated using JSP in excel format .