[]
An outline column displays hierarchical row data in a tree view. Use IWorksheet.getOutlineColumn() to access the outline column, then configure the column index, visibility options, and level settings for the hierarchy display.
worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
worksheet.getRange("A2").setIndentLevel(1);
IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
outlineColumn.setColumnIndex(0);
outlineColumn.setShowImage(true);
booleangetCheckStatus(int row) booleangetCollapsed(int row) intintbooleanbooleanbooleanvoidrefresh()voidsetCheckStatus(int row,
boolean checkStatus) voidsetCollapsed(int row,
boolean collapsed) voidsetCollapseIndicator(ImageSource value) voidsetColumnIndex(int value) voidsetExpandIndicator(ImageSource value) voidsetMaxLevel(int value) voidsetShowCheckBox(boolean value) voidsetShowImage(boolean value) voidsetShowIndicator(boolean value) The outline column displays hierarchical rows as a tree structure based on the indent levels in the worksheet.
worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
worksheet.getRange("A3").setIndentLevel(1);
IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
outlineColumn.setColumnIndex(0);
int columnIndex = outlineColumn.getColumnIndex();
The specified column is displayed as a tree structure for hierarchical rows.
worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
worksheet.getRange("A3").setIndentLevel(1);
IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
outlineColumn.setColumnIndex(0);
value - The zero-based index of the column to display as the outline column.When this property is enabled, the outline column can show the level images configured through getImages() for hierarchical rows.
worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
worksheet.getRange("A3").setIndentLevel(1);
IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
outlineColumn.setColumnIndex(0);
outlineColumn.setShowImage(true);
boolean showImage = outlineColumn.getShowImage();
When this property is enabled, the outline column can show the level images configured through getImages() for hierarchical rows.
worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
worksheet.getRange("A3").setIndentLevel(1);
IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
outlineColumn.setColumnIndex(0);
outlineColumn.setShowImage(true);
value - true to display images in the outline column; otherwise, false.When this property is enabled, the outline column shows a check box for rows in the hierarchical display.
worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
worksheet.getRange("A3").setIndentLevel(1);
IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
outlineColumn.setColumnIndex(0);
boolean showCheckBox = outlineColumn.getShowCheckBox();
When this property is enabled, the outline column shows a check box for rows in the hierarchical display.
worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
worksheet.getRange("A3").setIndentLevel(1);
IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
outlineColumn.setColumnIndex(0);
outlineColumn.setShowCheckBox(true);
value - true to display check boxes in the outline column; otherwise, false.The outline indicator shows the expand or collapse state for hierarchical rows displayed in the outline column.
worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
worksheet.getRange("A3").setIndentLevel(1);
IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
outlineColumn.setColumnIndex(0);
outlineColumn.setShowIndicator(true);
boolean showIndicator = outlineColumn.getShowIndicator();
The indicator is used to show the expand or collapse state for hierarchical rows displayed in the outline column.
worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
worksheet.getRange("A3").setIndentLevel(1);
IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
outlineColumn.setColumnIndex(0);
outlineColumn.setShowIndicator(true);
value - true to display the outline indicator; otherwise, false.The maximum level determines how many hierarchical row levels the outline column supports. The default value is 10.
worksheet.getRange("A1:A4").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}, {"Node 1.1.1"}});
worksheet.getRange("A3").setIndentLevel(1);
worksheet.getRange("A4").setIndentLevel(2);
IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
outlineColumn.setColumnIndex(0);
outlineColumn.setMaxLevel(3);
int maxLevel = outlineColumn.getMaxLevel();
The maximum level determines how many hierarchical row levels the outline column supports.
worksheet.getRange("A1:A4").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}, {"Node 1.1.1"}});
worksheet.getRange("A3").setIndentLevel(1);
worksheet.getRange("A4").setIndentLevel(2);
IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
outlineColumn.setColumnIndex(0);
outlineColumn.setMaxLevel(3);
value - The maximum row outline level.Use this method to access the image collection for the outline column. Each item in the returned list represents the image displayed for a specific outline level when images are enabled.
worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
worksheet.getRange("A3").setIndentLevel(1);
IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
outlineColumn.setColumnIndex(0);
outlineColumn.setShowImage(true);
outlineColumn.getImages().add(new ImageSource(new java.io.ByteArrayInputStream(new byte[] {(byte) 137, 80, 78, 71, 13, 10, 26, 10}), ImageType.PNG));
java.util.List<ImageSource> images = outlineColumn.getImages();
This image is displayed for expandable rows when the outline column shows hierarchy indicators.
IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
outlineColumn.setColumnIndex(0);
outlineColumn.setExpandIndicator(new ImageSource(
new java.io.ByteArrayInputStream(new byte[] {(byte) 137, 80, 78, 71, 13, 10, 26, 10}),
ImageType.PNG));
ImageSource indicator = outlineColumn.getExpandIndicator();
This image is displayed for expandable rows when the outline column shows hierarchy indicators.
worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
worksheet.getRange("A3").setIndentLevel(1);
IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
outlineColumn.setColumnIndex(0);
outlineColumn.setExpandIndicator(new ImageSource(
new java.io.ByteArrayInputStream(new byte[] {(byte) 137, 80, 78, 71, 13, 10, 26, 10}),
ImageType.PNG));
value - The image source for the expand indicator. Must not be null.This image is displayed for grouped rows when the outline column shows a collapse indicator for the current outline level.
worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
worksheet.getRange("A3").setIndentLevel(1);
IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
outlineColumn.setColumnIndex(0);
outlineColumn.setCollapseIndicator(new ImageSource(
new java.io.ByteArrayInputStream(new byte[] {(byte) 137, 80, 78, 71, 13, 10, 26, 10}),
ImageType.PNG));
ImageSource indicator = outlineColumn.getCollapseIndicator();
This image is displayed for collapsible rows when the outline column shows hierarchy indicators.
worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
worksheet.getRange("A3").setIndentLevel(1);
IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
outlineColumn.setColumnIndex(0);
outlineColumn.setCollapseIndicator(new ImageSource(
new java.io.ByteArrayInputStream(new byte[] {(byte) 137, 80, 78, 71, 13, 10, 26, 10}),
ImageType.PNG));
value - The image source for the collapse indicator. null is not supported.Use this method to set whether a row is currently marked as checked when the outline column displays check boxes.
worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
worksheet.getRange("A3").setIndentLevel(1);
IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
outlineColumn.setColumnIndex(0);
outlineColumn.setShowCheckBox(true);
outlineColumn.setCheckStatus(1, true);
row - The index of the row whose check status is to be changed.checkStatus - Whether the specified row is checked.Use this method after enabling check boxes to determine whether the specified outline row is checked.
worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
worksheet.getRange("A3").setIndentLevel(1);
IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
outlineColumn.setColumnIndex(0);
outlineColumn.setShowCheckBox(true);
outlineColumn.setCheckStatus(1, true);
boolean checked = outlineColumn.getCheckStatus(1);
row - The index of the row.Use this method to set whether a row in the outline hierarchy is displayed in a collapsed state.
worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
worksheet.getRange("A3").setIndentLevel(1);
worksheet.getOutline().setSummaryRow(SummaryRow.Above);
IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
outlineColumn.setColumnIndex(0);
outlineColumn.refresh();
outlineColumn.setCollapsed(1, true);
boolean collapsed = outlineColumn.getCollapsed(1);
row - The index of the row whose collapsed state is to be set.collapsed - true to display the specified row in a collapsed state; otherwise, false.Use this method to read the collapsed state of a row in the outline hierarchy.
worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
worksheet.getRange("A3").setIndentLevel(1);
worksheet.getOutline().setSummaryRow(SummaryRow.Above);
IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
outlineColumn.setColumnIndex(0);
outlineColumn.refresh();
outlineColumn.setCollapsed(1, true);
boolean collapsed = outlineColumn.getCollapsed(1);
row - The index of the row to get collapsed.Rebuilds the row outline hierarchy for the current outline column based on the current indent levels in the worksheet. Use this method after changing the hierarchical data or updating indent levels to apply the latest outline structure.
worksheet.getRange("A1:A4").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}, {"Node 2"}});
worksheet.getRange("A3").setIndentLevel(1);
IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
outlineColumn.setColumnIndex(0);
worksheet.getRange("A4").setIndentLevel(1);
outlineColumn.refresh();