我正在使用Apache POI库制作excel文件。 创建超过32767行的excel文件后,由于shortrow数据类型中的toprow参数,我无法设置showInPane。 当我传递超过32767行作为变量时,它给我一个错误。apache poi showInPane - 短数据类型参数
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覆盖短数据类型的最大值?
showInPane从阿帕奇的Javadoc
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
看起来像POI的错误,从文件时并没有这么多的日子行。我建议你在POI bug追踪器中发现一个bug ... – Gagravarr