[]
        
(Showing Draft Content)

IOutline

Interface IOutline


public interface IOutline
Represents an outline on a worksheet.

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);
 
  • Method Details

    • getSummaryColumn

      SummaryColumn getSummaryColumn()
      Gets the location of the summary columns in the outline.

      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();
       
      Returns:
      The location of the summary columns in the outline.
    • setSummaryColumn

      void setSummaryColumn(SummaryColumn value)
      Sets the location of the summary columns in the outline.

      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);
       
      Parameters:
      value - The summary column location. Must not be null.
    • getSummaryRow

      SummaryRow getSummaryRow()
      Gets the location of the summary rows in the outline.

      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();
       
      Returns:
      The location of the summary rows in the outline.
    • setSummaryRow

      void setSummaryRow(SummaryRow value)
      Sets the location of the summary rows in the outline.

      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);
       
      Parameters:
      value - The summary row location.
    • showLevels

      void showLevels()
      Displays the default row and column levels of the outline.

      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();
       
    • showLevels

      void showLevels(int rowLevels, int columnLevels)
      Displays the specified number of row and column levels in the worksheet outline.

      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);
       
      Parameters:
      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.
    • getRowGroupInfo

      List<IGroupInfo> getRowGroupInfo()
      Gets information about all groups in the row direction.

      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();
       
      Returns:
      information about all groups in the row direction.
    • getColumnGroupInfo

      List<IGroupInfo> getColumnGroupInfo()
      Gets information about all groups in the column direction.

      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);
       
      Returns:
      information about all groups in the column direction.