• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to download huge data in multiple excel using JSP

 
nash singh
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting huge data from database approx a million and trying to store it using csv format in excel like :
response.setContentType("application/ms-excel");
response.setHeader("Content-Disposition", "inline;filename=newfile.csv");

but as the data is huge and excel can take only 65K at one time its failing.

Please let me know how to code on the server side to save data in multiple excel files at one go....
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know what the limits on CSV files are that Excel can handle, but why don't you use a library that creates proper XLS files -like jExcelApi or Apache POI- and create a file that contains multiple sheets?

Or create XLSX (which POI can do as well) - it has fewer limits on its size than XLS.
 
nash singh
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a little new to poi ..please suggest some sample code to acheive above req.
Also I am not sure how to proceed
if I create multiple excel at server then I have to store it at some place and then zip it so that when user clicks submit the whole zip folder will be submitted.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The POI web site has numerous code examples.

Do you actually need to create multiple files? What I suggested was to create a single file with multiple sheets.

You're right that if you were to create multiple files, then you'd have to zip them up in order to download them as a single file. Using the java.util.zip package that's relatively easy, though.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!