[]
An IGroupInfo object describes a grouped row or column range in a worksheet outline. After obtaining a group from IOutline.getRowGroupInfo() or IOutline.getColumnGroupInfo(), use it to inspect the group's boundaries and hierarchy, or to expand and collapse the group.
worksheet.getRange("1:4").group();
IGroupInfo group = worksheet.getOutline().getRowGroupInfo().get(0);
int startIndex = group.getStartIndex();
int endIndex = group.getEndIndex();
group.collapse();
voidcollapse()voidexpand()intbooleanintgetLevel()intShows the rows or columns in the current outline group again after the group has been collapsed. If the group has a collapsed parent group, this method clears the current group's collapsed state, but the grouped rows or columns remain hidden until the parent group is expanded.
worksheet.getRange("2:5").group();
IGroupInfo group = worksheet.getOutline().getRowGroupInfo().get(0);
group.collapse();
group.expand();
This method hides the rows or columns in the current outline group and marks the group as collapsed. If the group is already collapsed, this method does nothing. Use getIsCollapsed() to determine the current collapse state, or expand() to show the grouped rows or columns again.
worksheet.getRange("2:5").group();
IGroupInfo group = worksheet.getOutline().getRowGroupInfo().get(0);
group.collapse();
Use this method together with getEndIndex() to determine the row or column span covered by the group.
worksheet.getRange("2:5").group();
IGroupInfo group = worksheet.getOutline().getRowGroupInfo().get(0);
int startIndex = group.getStartIndex();
The returned value identifies the last row or column index included in this group, depending on whether the group belongs to row or column outline information.
worksheet.getRange("2:5").group();
IGroupInfo group = worksheet.getOutline().getRowGroupInfo().get(0);
int endIndex = group.getEndIndex();
The returned value indicates the nesting depth of the group within the worksheet outline. Larger values represent groups that are nested deeper inside parent groups.
worksheet.getRange("1:4").group();
worksheet.getRange("2:3").group();
IGroupInfo group = worksheet.getOutline().getRowGroupInfo().get(0);
int level = group.getLevel();
Use this property to determine whether the rows or columns in the group are currently hidden because the group has been collapsed.
worksheet.getRange("2:5").group();
IGroupInfo group = worksheet.getOutline().getRowGroupInfo().get(0);
group.collapse();
boolean isCollapsed = group.getIsCollapsed();
true if the current group is collapsed; otherwise, false.Use this method to navigate from a nested group to the group that contains it.
worksheet.getRange("2:8").group();
worksheet.getRange("3:5").group();
IGroupInfo parentGroup = worksheet.getOutline().getRowGroupInfo().get(0);
IGroupInfo childGroup = parentGroup.getChildren().get(0);
IGroupInfo group = childGroup.getParent();
Child groups are nested outline groups whose range is contained within the current group. Use this method to traverse the outline hierarchy after retrieving a group from IOutline.getRowGroupInfo() or IOutline.getColumnGroupInfo().
worksheet.getRange("1:4").group();
worksheet.getRange("2:3").group();
IGroupInfo group = worksheet.getOutline().getRowGroupInfo().get(0);
List<IGroupInfo> children = group.getChildren();
null if the current group has no child groups.