Bug 57623 - Nested column groupings not working
Summary: Nested column groupings not working
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.11-FINAL
Hardware: PC Linux
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2015-02-23 12:57 UTC by effenberger.felix
Modified: 2020-04-15 16:29 UTC (History)
1 user (show)

Example code creating nested column groups (949 bytes, text/x-java)
2015-02-23 12:57 UTC, effenberger.felix

Note You need to log in before you can comment on or make changes to this bug.
Description effenberger.felix 2015-02-23 12:57:51 UTC
Created attachment 32509 [details]
Example code creating nested column groups

Excel supports nested column groups, but this feature is broken in POI (both in HSSF and XSSF implementations).

Assume that one wants to create two levels of column groupings, e.g. a group of columns 0 to 6 and two "sub-groups" of columns 0,2 and 4,6 as depicted below:

| A | B | C | D | E | F | G |
|++++++++++GROUP 1++++++++++|
|+++GROUP 2+++|+++GROUP 3+++|

The problem is that although the groups can be created, access to the groups is lost after creation (e.g. to set their collapsed/expanded attribute), as the POI API only provides methods to access column groups by columns they contain and no means to access groups on a given level; for fully overlapping groups thus access is lost, see function setColumnGroupCollapsed, https://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/Sheet.html#setColumnGroupCollapsed(int,%20boolean)

Example code for XSSF is attached. The xlsx should contain the nested column groups as described above, with all of them being collapsed initially. This is not the case though, as access to the groups 2 and 3 is lost.

Thanks for investigating this!