I am making an excel file using Apache POI library. After creating an excel file with more than 32767 rows, I can't set showInPane because of toprow parameter in short data type. When I pass more than 32767 row as a variable, it gives me an error. 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) Is there any way I can set the toprow overriding short data type maximum value? showInPane from Apache 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://stackoverflow.com/questions/17586245/apache-poi-showinpane-parameter-in-short-data-type
I have a fix for this available locally, but would like to keep it out of SVN until we have released POI 3.10 in order to not cause issues with binary compatibility any more between beta and final release. Please ping this Bug if it is not resolved after POI 3.10 is released.
Dominik - I'd suggest we add a new method with an int signature, and @deprecate the short one. That should let us maintain the backwards compatibility, whilst allowing people to opt-in (via an int not a short) to the fixed one
Ok, that's exactly what I was planning to do, I thought it might cause problems when people are using showInPane() with numerals, but I did some more checks now and it seems this cannot happen as e.g. "0" is an int, not short in Java and you need to cast it to short anyway. This is now checked in for POI 3.10.