• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem when downloading excel sheet from struts application using Internet explorer

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic