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 Struts and the fly likes problem when downloading excel sheet from  struts application using Internet explorer 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 » Frameworks » Struts
Bookmark "problem when downloading excel sheet from  struts application using Internet explorer" Watch "problem when downloading excel sheet from  struts application using Internet explorer" New topic
Author

problem when downloading excel sheet from struts application using Internet explorer

vijayz devraj
Greenhorn

Joined: Apr 03, 2008
Posts: 7
My struts application aim is to download data from mysql to excel sheet. the problem is,,, whenever iam downlaoding a excel file from struts application using internet explorer browser iam able to download the excel sheet but the data is not displayed.
but if i use mozilla firefox and download the excel sheet i can view the data also..

my code to download the excel sheet is
}
response.reset();
byte[] blobdata1 = wb1.getBytes();
response.setContentType("application/vnd.ms-excel: xls, xlb: Microsoft Excel Document");
response.setHeader("Content-Disposition", "inline; filename=" + title+".xls");
response.setDateHeader("max-age", 0);
response.setHeader("cache-control", "no-cache");
response.setHeader("Content-Encoding", "en-US");
response.setHeader("Connection", "keep-alive");
response.setHeader("Expires", "0");
response.setHeader("Pragma", "no-cache");
OutputStream out = response.getOutputStream();
int off = 0;
int l = (int) wb1.getBytes().length;
out.write(blobdata1, off, l);
out.flush();
out.close();
}

please let me know what changes i need to do so that ican downlaod and view the data in excel sheet by using internet explorer...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: problem when downloading excel sheet from struts application using Internet explorer
 
Similar Threads
convert excel
problem with download manager in IE browser.
download problem
problem with download manager in IE browser.
problem in headers and content types