poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 55294] New: Make POI producing <col> elements compatible with MS Excel
Date Mon, 22 Jul 2013 21:52:20 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=55294

            Bug ID: 55294
           Summary: Make POI producing <col> elements compatible with MS
                    Excel
           Product: POI
           Version: 3.9
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: vladk.dev@gmail.com

The OOXML spec leaves some fields optional and doesn't define what should
happen if, for instance "width" attribute is not set on a "col" element.

The MS Excel 2010 never leaves the "width" attribute unset, the POI does it. As
result the XLSX files created with POI can look corrupted when opened with MX
Excel 2010.

I have created a patch to make POI behaves more like MS Excel and written
several unit tests to verify it. The changes could be summarized as follows:
- never leave the "width" attribute unset
- never let a column being defined by more than one "col" element

In other words, avoid configuration like follows:
<cols>
       <col min="3" max="3" width="20.0" customWidth="true" collapsed="false"
outlineLevel="1" />
       <col min="3" max="5" collapsed="false" outlineLevel="1" />
</cols>
Instead create something like this:
<cols>
       <col min="3" max="3" width="20.0" customWidth="true" collapsed="false"
outlineLevel="1" />
       <col min="4" max="5" width="8.0" collapsed="false" outlineLevel="1" />
</cols>

I have decided to created a separate test class TestXSSFColGrouping instead of
adding test methods to the TestXSSFSheet near to the
testSetColumnGroupCollapsed() method, because my tests can save generated XLSX
files on a disk if a system property "poi.test.xssf.output.dir" is set. It
helps to verify the files interpreted as expected in MS Excel. Furthermore the
tests log CTCols content via private instance of the POILogger.

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

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


Mime
View raw message