Bug 63748

Summary: Automatically create new sheet when row count exceeds 1048576.
Product: POI Reporter: Nilesh <nileshwani.vit>
Component: SXSSFAssignee: POI Developers List <dev>
Status: RESOLVED WONTFIX    
Severity: enhancement    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   

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).