It's not a secret anymore!
The moose likes JSP and the fly likes Download it in different sheets in Excel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Download it in different sheets in Excel" Watch "Download it in different sheets in Excel" New topic

Download it in different sheets in Excel

Mike Thomson
Ranch Hand

Joined: Nov 07, 2007
Posts: 121

I have a requirement to download the data from DB to CSV/Excel. What I did is retrieving all the records from DB and store in the List and pass that list to the jsp page. In JSP page, I am using the below setting to download it to CSV/EXCEL.

It was working fine. But I have an issues in it. Excel is capable of storing it only 65,536 rows.
Even all the data getting downloaded to CSV/excel (> 65,536), while saving I am getting error from excel saying that it can't save more than 65,536 rows and the below data won't be saved.

I am not opt for POI apache third party at this point of time.
Is it possible to download it in other sheets if it exceeds the max limit.

Example: Having data of around 100,000.

Download 65,536 - Sheet 1
Remaining in Sheet 2,3.. of the same excel.

Any idea/input/suggestion on it?
NagendraBabu Gonugunta

Joined: Dec 19, 2012
Posts: 1
You can create different sheets in same excel.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
No human being is going to want to (or be able to) look at 100K records. If, OTOH, this data is mean for machine consumption then it doesn't make sense to use Excel files - CSV should work fine.

I'm curious what kind of output the JSP creates - you specify that it's XLS but you say it is CSV - which one is it? If the code writes CSV then it should specify that it writes CSV.
J. Kevin Robbins

Joined: Dec 16, 2010
Posts: 1522

You're both responding to a post that's over 4 years old and a user that hasn't logged on in 3 years.

"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
subject: Download it in different sheets in Excel
It's not a secret anymore!