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

--- Comment #2 from vladk <[email protected]> ---
It appears that Excel 2010 doesn't like column definitions with undefined
"width" attribute like follows:
<cols>
    <col min="5" max="5" width="20.0" customWidth="true" collapsed="false"
outlineLevel="1"/>
    <col min="6" max="8" collapsed="false" outlineLevel="1"/>
</cols>

The Excel 2010 would create the following column configuration:
<cols>
    <col min="5" max="5" width="20.0" customWidth="1" outlineLevel="1"/>
    <col min="6" max="8" width="11.42578125" customWidth="1" outlineLevel="1"/>
</cols>
whereas width="11.42578125" seems to be the default width for my system.

According to the specification width is an optional attribute with unspecified
default value: http://www.schemacentral.com/sc/ooxml/e-ssml_col-1.html


The mentioned column configuration was produced by the following code:
    sheet1.setColumnWidth(4, 20*256);
    sheet1.groupColumn( (short)4, (short)7 );


A workaround is to set explicit width for all grouped columns after the
grouping:
    sheet1.setColumnWidth(4, 20*256);
    sheet1.groupColumn( (short)4, (short)7 );
    sheet1.setColumnWidth(5, sheet1.getDefaultColumnWidth() * 256);
    sheet1.setColumnWidth(6, sheet1.getDefaultColumnWidth() * 256);
    sheet1.setColumnWidth(7, sheet1.getDefaultColumnWidth() * 256);

Does anyone have an idea what where the proper class/method to modify POI to
make it setting "width" attribute always?

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