[]
An IOutline object provides access to worksheet outline settings such as the locations of summary rows and summary columns, the visible outline levels, and grouped row or column information.
worksheet.getRange("2:5").group();
IOutline outline = worksheet.getOutline();
outline.setSummaryRow(SummaryRow.Above);
outline.showLevels(1, 0);
voidsetSummaryColumn(SummaryColumn value) voidsetSummaryRow(SummaryRow value) voidvoidshowLevels(int rowLevels,
int columnLevels) Use this method to determine whether the summary column is displayed to the left or to the right of the detail columns in a column outline.
worksheet.getRange("A:C").group();
IOutline outline = worksheet.getOutline();
outline.setSummaryColumn(SummaryColumn.Left);
SummaryColumn summaryColumn = outline.getSummaryColumn();
Use this method to control whether the summary column is displayed to the left or to the right of the detail columns in a column outline.
worksheet.getRange("A:C").group();
IOutline outline = worksheet.getOutline();
outline.setSummaryColumn(SummaryColumn.Left);
value - The summary column location. Must not be null.Use this method to determine whether summary rows are displayed above or below the detail rows for grouped data in the worksheet outline.
worksheet.getRange("2:5").group();
IOutline outline = worksheet.getOutline();
outline.setSummaryRow(SummaryRow.Above);
SummaryRow summaryRow = outline.getSummaryRow();
Use this method to control whether summary rows for grouped data are displayed above or below the detail rows. Set this property with SummaryRow.Above to place summary rows above the grouped rows, or SummaryRow.Below to place them below the grouped rows.
worksheet.getRange("2:5").group();
IOutline outline = worksheet.getOutline();
outline.setSummaryRow(SummaryRow.Above);
value - The summary row location.This overload calls showLevels(int,int) with the default row and column level values. Use it as a convenience overload when you want the implementation's default outline-level behavior, or call showLevels(int,int) to specify explicit row and column levels.
worksheet.getRange("2:5").group();
worksheet.getRange("A:C").group();
IOutline outline = worksheet.getOutline();
outline.showLevels();
Use this method to control how many grouped levels are visible for rows and columns. If the outline contains fewer levels than the specified value, all available levels are shown. A value of 0 leaves the corresponding direction unchanged.
worksheet.getRange("2:5").group();
worksheet.getRange("B:D").group();
IOutline outline = worksheet.getOutline();
outline.showLevels(1, 1);
rowLevels - The number of row outline levels to display. If this value is greater than the available row levels, all row levels are shown. If this value is 0, row outline levels are not changed.columnLevels - The number of column outline levels to display. If this value is greater than the available column levels, all column levels are shown. If this value is 0, column outline levels are not changed.Returns the top-level row groups in the worksheet outline. Nested row groups can be accessed from the child groups of each returned IGroupInfo.
worksheet.getRange("1:4").group();
worksheet.getRange("2:3").group();
List<IGroupInfo> groups = worksheet.getOutline().getRowGroupInfo();
IGroupInfo group = groups.get(0);
int level = group.getLevel();
Use this method to retrieve the column grouping structure in the worksheet outline. Each returned IGroupInfo describes a grouped column range and can be used to inspect the group hierarchy or expand and collapse groups.
worksheet.getRange("A:D").group();
worksheet.getRange("A:B").group();
IOutline outline = worksheet.getOutline();
java.util.List<IGroupInfo> groups = outline.getColumnGroupInfo();
IGroupInfo firstGroup = groups.get(0);