Grouping Columns or Rows is tieing them to make them collapsible and expandable.
For a list of data that has to be grouped an outline of up to eight levels can be created, one for each group. Each inner level is represented by a higher number and the preceding outer level, represented by a lower number in the outline symbols.Outline quickly displays summary of rows or columns, or to reveal the detail data for each group. You can create an outline of rows an outline of columns, or an outline of both rows and columns from the 'Group' button of the 'Outline' group of 'Data' tab.
or,by just introducing the following in 'sheetX.xml',considering both rowsand columns are grouped
<worksheet xmlns="...." >
-----
<sheetFormatPr defaultRowHeight="15" outlineLevelRow="1" outlineLevelCol="1" />
----
</worksheet>
Assume,rows A1 to A3 are to be collapsed (or grouped),add the attribute 'outlineLevel="1"' to the node 'row' corresponding to rows A1,A2 and A3
<row r="1" spans="1:5" outlineLevel="1" >
This displays the rows in expandable form.to collapse A1,A2 and A3 add the attribute 'hidden="1"' to the node 'row',i.e
<row r="1" spans="1:5" outlineLevel="1" hidden="1" >
and to the row A4(which is not to be grouped),add 'collapsed="1"'
In case of grouping of columns,say columns C2 to E2,add
--
<cols>
<col min="3" max="5" customWidth="1" outlineLevel="1" />
Here,'min' refers to Column to begin from(C) and 'max' the last column effected in this purpose,i.e 5th column(E)
To collapse the group,to column 6,i.e F(which is not part of the group),set
<col min="3" max="5" hidden="1" outlineLevel="1" />
and
<col
This was for level one,to nest the levels,say for second level,where rows A2 to A6 are grouped to form the first level in which rows A2 -A4 are grouped as 2nd level,ditto rows A5-A6.
in sheetFormatPr set 'outlineLevelRow="2" ',and now the row A2 must be,
<row r="2" spans="1:6" customFormat="1" outlineLevel="2">
which is same for row A5.
<row r="5" spans="1:6" customFormat="1" outlineLevel="2">
and to all the other rows,A1,A3,A4 and A6 would have 'outlineLevel="1" '
Similarly in case of columns,say A to E are to be grouped as first level ,and A,B,C as group at 2nd level
<col min="1" max="3" outlineLevel="2" />
<col min="4" max="5" outlineLevel="1" />