0

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 download data in multiple excel files at one go....

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by stephen84s
0

The data download for your newfile.csv, doesn't fail, it is downloaded, try opening that file via notepad or some other text editor and you should get have all the data in it (even if the file has more than 65535 rows), the problem is with 'MS Excel', it cannot handle more than 65k rows.
If you have to use 'MS Excel' to view or manipulate your data then in that case take a look at the Apache POI and write your data into an XLS format (Currently you are using the good ol' comma-separated-version CSV), and use multiple sheets to store your data in case it exceeds 65535 rows.

Note:-
XLS is the name of the extension used when you save the file in Excel '97(-2007) format. The formal format name my guess is BIFF8

Edited by stephen84s: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.