jQuery in Action, 2nd edition*
The moose likes JSP and the fly likes Error in excel report generation from jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Error in excel report generation from jsp" Watch "Error in excel report generation from jsp" New topic
Author

Error in excel report generation from jsp

vidya archana
Ranch Hand

Joined: Oct 29, 2002
Posts: 36
Pls find the code below..

I am trying to generate the report from jsp:

<%
response.setContentType("application/vnd.ms-excel.xls");
response.setHeader("content-disposition","attachment;filename=test.xls");
%>

<html>
<head>
<title>Excel</title>
</head>
<body>
<table>
----data comes here
</table>
</body>

When i run this, i am getting a Open/Save dialog box. If i try to save the excel, i am able to vdo that without any problem. And if an excel instance is already opened in my system, and i select open option from the dialog box, again this report is getting opened. But at the same time, if no excel instance is already opened, and i try to open, the excel I am getting an error saying:
"c:\Documents and Settings\199872\Local Settings\Temporary Internet Files\Content.IE5\WV5VMYZ5\test[1].xls could not be found" Please check the file name..etc..

Pls help me in solving this..
[ December 10, 2007: Message edited by: vidya archana ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

I've seen that happen in MSIE 6 when the amount of files saved gets close to the limit set in MSIE. Try using Tools -> Menus -> ... delete temporary internet files.
See if that fixes it for you.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
vidya archana
Ranch Hand

Joined: Oct 29, 2002
Posts: 36
still not working
Ray Johnson
Greenhorn

Joined: Dec 14, 2007
Posts: 13
similar errors mostly involve environment related issues such as installed versions of excel, windows & IE combinations, security setups. In case the problem is not solved yet, try the following things and see if they help
0. Check your MS Excel opens cleanly in your machine
1. Set buffer cache of that JSP page to 0 and see.
2. Save the spreadsheet to your local file system. Make sure all excel applications are closed. select the saved spreadsheet, right click and use open with IE and check for any significant delay/errors.
3. If you are in a office network, try from some of your other colleagues' systems, preferably those having different versions installed.

Post your findings. If nothing works, throw some more details on the error with details of your environment. good luck. in case, the problem is already fixed, can you share the steps used to fix?


"It's been so long since I've done a good thing--the right thing" : Tears Of Sun
 
jQuery in Action, 2nd edition
 
subject: Error in excel report generation from jsp
 
Similar Threads
CSV file to open in Excel
Writing on excel file using POI
Error in excel sending additional request
Error in excel sending additional request
how to download or view the "Excel FILE "i n IE browser