File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Problem in exporting output of jsp to excel file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Problem in exporting output of jsp to excel file " Watch "Problem in exporting output of jsp to excel file " New topic
Author

Problem in exporting output of jsp to excel file

Mandar Velankar
Ranch Hand

Joined: Jul 31, 2006
Posts: 32
Hi,
I am using Tomcat 5.0.16 , I try to export output of jsp page (data in tabular format) to excel file. It is creating a new(empty)excel sheet but problem is my data in tabular format is not exported.Where is problem?

I already made MIME Type entry in web.xml file in conf dir.

I used following code :
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition","attachment; filename=myFilename.xls");

Surprise is above code is working for one jsp page (in different dir) but not in current page.
Where is mistake? Can anybody help me?
Thanks a lot.
Regards,
Mandar Velankar
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

Originally posted by Mandar Velankar:

I already made MIME Type entry in web.xml file in conf dir.


why you entered MIME type entry in web.xml. You have already defined in you jsp though?


have a look this example of JSP and Excel in javaranch..
[ January 19, 2007: Message edited by: Saif uddin ]

Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in exporting output of jsp to excel file
 
Similar Threads
Printing contents
Upload Data in Excel file
xlxs extention does not support
Jsp to pdf
Drawing Dynamic Graph Using Java/J2EE Technology