我正在使用 Apache POI 库制作一个 excel 文件。创建超过 32767 行的 excel 文件后,由于 toprow 参数为短数据类型,我无法设置 showInPane。当我将超过 32767 行作为变量传递时,它会给我一个错误。
java.lang.IllegalArgumentException: row index may not be negative
at org.apache.poi.ss.util.CellReference.<init>(CellReference.java:133)
at org.apache.poi.ss.util.CellReference.<init>(CellReference.java:127)
at org.apache.poi.ss.util.CellReference.<init>(CellReference.java:119)
at org.apache.poi.xssf.usermodel.XSSFSheet.showInPane(XSSFSheet.java:2380)
有什么方法可以设置 toprow 覆盖短数据类型的最大值?
来自 Apache Javadoc 的 showInPane
void showInPane(short toprow, short leftcol)
Sets desktop window pane display area, when the file is first opened in a viewer.
Parameters:
toprow - the top row to show in desktop window pane
leftcol - the left column to show in desktop window pane
http://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/Sheet.html