2013-07-11 40 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