Bug 63748 - Automatically create new sheet when row count exceeds 1048576.
Summary: Automatically create new sheet when row count exceeds 1048576.
Alias: None
Product: POI
Classification: Unclassified
Component: SXSSF (show other bugs)
Version: unspecified
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2019-09-13 10:30 UTC by Nilesh
Modified: 2021-07-28 21:10 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Nilesh 2019-09-13 10:30:28 UTC
I have a requirement where i need to create a new sheet and write the overflowing data(1048576+ rows) on that sheet.
I can do it by creating a code which keeps a counter each time before creating a new row and create a new sheet and continue writing the remaining data on new sheet.

I need to know is there any API that does the same or if any tried and tested way available already ?
currently Using POI 3.16
Comment 1 gallon.fizik@gmail.com 2019-09-13 13:52:09 UTC
Hello Nilesh,

unfortunately there's no such API call as it's not something Excel/POI does.

I suggest you to implement some Supplier<Row> which will track its position on a sheet and create a new one, if necessary.

P.S. You probably don't need a counter, just hold a reference to the last/newly created row and compare its index to the SpreadsheetVersion.yourVersion().getMaxRowIndex() (may not remember the name exactly).