Bug 55076 - collapsing column groups only hides the first column
Summary: collapsing column groups only hides the first column
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.9-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2013-06-07 15:22 UTC by Frank Plößel
Modified: 2016-09-22 04:28 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Frank Plößel 2013-06-07 15:22:57 UTC
If you are using column groups and then call collapse(), only the first column of the group is hidden, the others are still visible.

This happens in XSSF and SXSSF.

As far as I understand the POI code, the issue seems to be that the grouping of columns adds an entry e. g. for a three column group
<col min="10" max=12" ... />
to the sheet columns.
Then we set column widths in our code, which splits this entry into three, each for one column with identical min and max attributes. But the new ones are inserted at the begin of the list, not sorted by column number.
And the collapse() code seems to search only forward in the list after having found the first column wen it sets the hidden="1" attribute.
Comment 1 Nick Burch 2013-06-07 15:31:36 UTC
Are you able to produce a unit test showing this? And ideally a patch too! But a unit test would be the first bit, so we can confirm how it's broken, and ideally check it gets fixed later (+stays fixed!)
Comment 2 Javen O'Neal 2016-09-22 04:28:21 UTC
Added a failing unit test in r1761846.

This bug only occurs when the grouped columns have different column widths.
I started having issues after r1706789 which was added in POI 3.13.

Also take a look at bug 59932, which is also related to column grouping and collapsing.