I would like to know what is maximum number of row you can create with apache poi 3.8 and what is the maximum number you can create with apache poi 3.0 for generating excel files.
Another SO user has provided a method to create many rows with POI 3.8. The maximum number of rows are limited by the maximum in the version of Excel you try to open the file in, as well. The int
data type is returned by getRowNum
(see API), so that could provide your "maximum", but going beyond the number of rows specified in the Excel version (~65k in 2003, 1,048,576 in 2007+) will mean data is lost and potential errors.
just in case you want to catch it, this is the Exception that gets thrown.
java.lang.IllegalArgumentException: Invalid row number (65536) outside allowable range (0..65535)
These limit values are provided by POI: https://poi.apache.org/apidocs/org/apache/poi/ss/SpreadsheetVersion.html
Specifically: SpreadsheetVersion.EXCEL97.getMaxRows()
and SpreadsheetVersion.EXCEL2007.getMaxRows()
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With