apache poi最大行数

时间:2022-11-25 22:15:52

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.

我想知道你可以使用apache poi 3.8创建的最大行数是多少,使用apache poi 3.0生成excel文件的最大数量是多少。

3 个解决方案

#1


7  

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.

另一个SO用户提供了一种使用POI 3.8创建许多行的方法。最大行数受限于您尝试打​​开文件的Excel版本中的最大行数。 getRowNum返回int数据类型(参见API),因此可以提供“最大值”,但超出Excel版本中指定的行数(2003年约为65k,2007 +为1,048,576)将意味着数据丢失和潜在的错误。

#2


3  

These limit values are provided by POI: https://poi.apache.org/apidocs/org/apache/poi/ss/SpreadsheetVersion.html

这些限制值由POI提供:https://poi.apache.org/apidocs/org/apache/poi/ss/SpreadsheetVersion.html

Specifically: SpreadsheetVersion.EXCEL97.getMaxRows() and SpreadsheetVersion.EXCEL2007.getMaxRows().

具体来说:SpreadsheetVersion.EXCEL97.getMaxRows()和SpreadsheetVersion.EXCEL2007.getMaxRows()。

#3


1  

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)

#1


7  

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.

另一个SO用户提供了一种使用POI 3.8创建许多行的方法。最大行数受限于您尝试打​​开文件的Excel版本中的最大行数。 getRowNum返回int数据类型(参见API),因此可以提供“最大值”,但超出Excel版本中指定的行数(2003年约为65k,2007 +为1,048,576)将意味着数据丢失和潜在的错误。

#2


3  

These limit values are provided by POI: https://poi.apache.org/apidocs/org/apache/poi/ss/SpreadsheetVersion.html

这些限制值由POI提供:https://poi.apache.org/apidocs/org/apache/poi/ss/SpreadsheetVersion.html

Specifically: SpreadsheetVersion.EXCEL97.getMaxRows() and SpreadsheetVersion.EXCEL2007.getMaxRows().

具体来说:SpreadsheetVersion.EXCEL97.getMaxRows()和SpreadsheetVersion.EXCEL2007.getMaxRows()。

#3


1  

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)