2013-07-11 38 views
1

我正在使用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

+1

看起来像POI的错误,从文件时并没有这么多的日子行。我建议你在POI bug追踪器中发现一个bug ... – Gagravarr

回答

1

您需要升级到Apache POI的新版本 - 多米尼克·施泰德固定这个bug您在r1502749

你会想在每晚构建从2013年7月14日或以后,还是要等POI 3.10 Beta 2的

+0

3.10 Beta2没有解决问题。我希望这将在下一个版本中应用。 – handicop

+1

3.10 beta 2还没有出来... – Gagravarr

+0

对不起,它是从nightly构建。 https://builds.apache.org/job/POI/lastSuccessfulBuild/artifact/build/dist/ – handicop