This seems to be a repeat of Bug 45322, which was fixed for POI 3.2. This is now happening in 3.5-FINAL. I'm getting the same outofboundsexception when performing an autoSizeColumn on columns whose data format returns -1.
Can you attach a file and sample code to reproduce the problem? 3.5-FINAL works fine for the file attached to Bug 45322. Yegor
Created attachment 24439 [details] XLSServlet.java generates spreadsheet data.
Attached code. Unable to generate a file because it fails on autoSizeColumn.
FYI: The following line of code was added to bypass the exception: if ( null != row.getCell(i) && null != row.getCell(i).getCellStyle() && row.getCell(i).getCellStyle().getDataFormat() > -1 ) With that line removed, the exception occurs at: sheet.autoSizeColumn((short)i);
If you attempt to use org.apache.poi.hssf.usermodel.HSSFSheet and method autosizecolumn(int) on a column after setting more than 32767 cells then ArrayOutOfBoundsException is thrown. I found this while accessing java via ColdFusion, i doubt you'll want my source code! This major bug is still present in version 3.7.
In r1072093 I have added a test which shows we can size columns with very large (>32767) numbers of rows without error. So, looks like this bug is no longer present.