https://bz.apache.org/bugzilla/show_bug.cgi?id=57450

Javen O'Neal <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #15 from Javen O'Neal <[email protected]> ---
Added in r1717146. Updated docs in r1717147.

Note to implementers:
This fix may break existing code.
If your application uses or potentially uses SXSSFSheets and calls
autoSizeColumn, you will need to make sure that the columns that are auto-sized
are tracked prior to auto-sizing. The best place to do this tracking is
immediately after the sheet is created.
Use any of the following:
* sxssfSheet.trackAllColumnsForAutoSizing()
* sxssfSheet.trackColumnsForAutoSizing(int column)
* sxssfSheet.trackColumnsForAutoSizing(Collection<Integer> columns)

Realize that tracking all columns may have a larger memory footprint than
tracking individual columns if you only intend on tracking some of the columns.

If the sheet type isn't known until runtime, you'll need to add the following
to your code.
Sheet sheet = workbook.createSheet();
+ if (sheet instanceof SXSSFSheet) {
+    SXSSFSheet sxSheet = (SXSSFSheet) sheet;
+    sxSheet.trackAllColumnsForAutoSizing();
+    // or track columns individually
+ }
...
sheet.autoSizeColumn(0);

See comment 13 for more info.

-- 
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]

Reply via email to