*
The moose likes JSP and the fly likes More... on how to generate output from Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "More... on how to generate output from "jsp to excel"" Watch "More... on how to generate output from "jsp to excel"" New topic
Author

More... on how to generate output from "jsp to excel"

vijay sinha
Greenhorn

Joined: Jul 18, 2002
Posts: 20
Hi People,
requirement: I have to generate reports of the output from a jsp into excel spreadsheet. Presently its displayed in a html page.

what i did: I have searched the forum for generating the output from a "jsp to excel sheet" but couldn't get a complete idea/solution of how this output is generated.
i have got some info from the forum on "javaexcelapi" and from apache reg. "hssf". I tested with javaexcelapi and it seems to work fine except that i haven't gone into details as to what other factors i need to look upon to start using this api in my project.
Could someone who had executed such a requirement, please can you share information on did the complete module was built?
many thanks,
vijay
[ August 08, 2002: Message edited by: vijay sinha ]
Tiffany Sun
Greenhorn

Joined: Oct 02, 2001
Posts: 26
I don't know if this is what you want, but here's what I did to generate Excel spreadsheets:
<%@ page contentType="application/vnd.ms-excel" %>
or
response.setContentType("application/vnd.ms-excel");
[ August 07, 2002: Message edited by: Tiffany Sun ]

SCJP, SCWCD, IBM-XML
vijay sinha
Greenhorn

Joined: Jul 18, 2002
Posts: 20
Thanks Tiffany, I have to kick myself for the dumbness/laziness about this(not reading the "core servlets" ! A "single line of code" could have changed my thought process for the problem at hand.
Why i mean is that i was really thinking to resolve in terms of including 'javaexcelapi' as a means to generate the excel sheet and thereby formatting it. But, as i go through for the 2nd time with my google-search, i found that the latest excel recognizes the html table and we have to only work around the html table generation to get the ouput in excel...
Now, my problem is w.r.t the html table. I am generating this table dynamically (like incl. jsp scriptlets...etc) The excel doesn't recognize if i put "response.setContentType=..." while i generate the html table.
This seems to have come up in one of the earlier threads, but i couldn't get an answer...
Did any one has found a solution to this kind...pls. share...

vijay
[ August 08, 2002: Message edited by: vijay sinha ]
evan theon
Ranch Hand

Joined: Feb 16, 2005
Posts: 39
the content-type solution you gave would be great for MS Excel, what should i do to convert my jsp page into openoffice spreadsheet?
 
 
subject: More... on how to generate output from "jsp to excel"
 
Similar Threads
how to print a jframe ?
Saving data to Excel files
Export data to various formats in jsp using taglibs - how?
Generate Excel file
Redirecting to a generated excel file