https://issues.apache.org/bugzilla/show_bug.cgi?id=50853
Summary: Auto-size usage can seriously limit row count
Product: POI
Version: 3.6
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: HSSF
AssignedTo: [email protected]
ReportedBy: [email protected]
Excel 2003 has 64K row limit and I can export up to 64K rows using POI, but
only if I don't use sheet.autoSizeColumn(i) method.
Here's a simple example that leads to this problem: try to create a sheet with
over 33K rows (I used 34K) and a single column. When data is written, call
sheet.autoSizeColumn to auto-fit the column and it breaks with this exception.
java.lang.ArrayIndexOutOfBoundsException: -32732
at java.util.ArrayList.get(ArrayList.java:324)
at
org.apache.poi.hssf.model.WorkbookRecordList.get(WorkbookRecordList.java:50)
at org.apache.poi.hssf.model.Workbook.getExFormatAt(Workbook.java:787)
at
org.apache.poi.hssf.usermodel.HSSFCell.getCellStyle(HSSFCell.java:906)
at
org.apache.poi.hssf.usermodel.HSSFSheet.autoSizeColumn(HSSFSheet.java:1727)
at
org.apache.poi.hssf.usermodel.HSSFSheet.autoSizeColumn(HSSFSheet.java:1662)
When there are more columns it breaks even sooner than that. My usecase has ~50
columns and it breaks even with 2K rows. It looks like it uses short int data
type and it goes out of range.
Let me know if you need more info.
Cheers
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]