https://issues.apache.org/bugzilla/show_bug.cgi?id=55644

--- Comment #10 from Sebastien Arod <sebastien.a...@gmail.com> ---
Debugging shows that using oracle jre 7u21 layout.getBounds().getWidth()
returns 0 in org.apache.poi.ss.util.SheetUtil.getCellWidth(Cell, int,
DataFormatter, boolean)

This may be related to this jdk bug
https://bugs.openjdk.java.net/browse/JDK-8013716.


The problem can be mitigated by detecting when auto sizing fails and using a
minimal width:

sheet.autoSizeColumn(0)
if (sheet.getColumnWidth(0) == 0) {
  // autosize failed use MIN_WIDTH
  sheet.setColumnWidth(0, MIN_WIDTH);
}

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to