https://issues.apache.org/bugzilla/show_bug.cgi?id=47581
Summary: XSSFSheet.setColumnWidth does not do anything
Product: POI
Version: 3.5-dev
Platform: PC
OS/Version: Mac OS X 10.4
Status: NEW
Severity: normal
Priority: P2
Component: XSSF
AssignedTo: [email protected]
ReportedBy: [email protected]
After being dissatisfied with the results of XSSFSheet.autoSizeColumn, I tried
to use XSSFSheet.setColumnWidth to implement my own crude attempt at column
width fitting. Nothing happened. The columns in the output .xlsx were all the
default width.
Armed with the knowledge that autoSizeColumn was able to do something, if not
what I wanted, but setColumnWidth was not, I looked at the source. Turns out
autoSizeColumn calls columnHelper.setColBestFit and columnHelper.setCustomWidth
when it sets the width it computed, whereas setColumnWidth does not.
Workaround: I was able to set my computed widths by calling the columnHelper
methods prior to the setColumnWidth call (easy to do from JRuby — from Java,
you probably need a reflection hack). Actually, it looks like you only need
either one of the columnHelper calls, not both.
--
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]