public final class ExcelViewOptions extends Object
Modifier and Type | Method and Description |
---|---|
int |
getFirstVisibleColumn()
Gets index of the first visible column in the worksheet.
|
int |
getFirstVisibleRow()
Gets index of the first visible row in the worksheet.
|
int |
getPageBreakViewZoom()
Magnification factor in page break view.
|
ViewType |
getViewType()
Gets the view type.
|
int |
getZoom()
Magnification factor in normal view.
|
boolean |
isOutlineColumnButtonsRight()
Gets whether outline column buttons are displayed on the right side of groups.
|
boolean |
isOutlineRowButtonsBelow()
Gets whether outline row buttons are displayed below groups.
|
boolean |
isShowColumnsFromRightToLeft()
If true, MS Excel shows columns from right to left.
|
boolean |
isShowFormulas()
If true, MS Excel shows formulas.
|
boolean |
isShowGridLines()
If true, MS Excel shows grid lines.
|
boolean |
isShowInPageBreakPreview()
If true, MS Excel shows worksheet in page break preview.
|
boolean |
isShowOutlineSymbols()
If true, MS Excel shows outline symbols.
|
boolean |
isShowSheetHeaders()
If true, MS Excel shows row and column headers.
|
boolean |
isShowZeroValues()
If true, MS Excel shows zero values.
|
void |
setFirstVisibleColumn(int firstVisibleColumn)
Sets index of the first visible column in the worksheet.
|
void |
setFirstVisibleRow(int firstVisibleRow)
Sets index of the first visible row in the worksheet.
|
void |
setOutlineColumnButtonsRight(boolean outlineColumnButtonsRight)
Sets whether outline column buttons are displayed on the right side of groups.
|
void |
setOutlineRowButtonsBelow(boolean outlineRowButtonsBelow)
Sets whether outline row buttons are displayed below groups.
|
void |
setPageBreakViewZoom(int zoom)
Magnification factor in page break view.
|
void |
setShowColumnsFromRightToLeft(boolean showColumnsFromRightToLeft)
If true, MS Excel shows columns from right to left.
|
void |
setShowFormulas(boolean showFormulas)
If true, MS Excel shows formulas.
|
void |
setShowGridLines(boolean showGridLines)
If true, MS Excel shows grid lines.
|
void |
setShowInPageBreakPreview(boolean showInPageBreakPreview)
If true, MS Excel shows worksheet in page break preview.
|
void |
setShowOutlineSymbols(boolean showOutlineSymbols)
If true, MS Excel shows outline symbols.
|
void |
setShowSheetHeaders(boolean showSheetHeaders)
If true, MS Excel shows row and column headers.
|
void |
setShowZeroValues(boolean showZeroValues)
If true, MS Excel shows zero values.
|
void |
setViewType(ViewType viewType)
Sets the view type.
|
void |
setZoom(int zoom)
Magnification factor in normal view.
|
public int getFirstVisibleColumn()
Default value is 0.
public int getFirstVisibleRow()
Default value is 0.
public int getPageBreakViewZoom()
Unit is one percent.
Default value is 60.
public ViewType getViewType()
Default value is ViewType.Normal
.
View type is supported only for XLSX (Excel 2007+) files.
public int getZoom()
Unit is one percent.
Default value is 100.
public boolean isOutlineColumnButtonsRight()
This value is simply written to Excel file and has no effect on behavior of this library. For more information on worksheet protection, consult Microsoft Excel documentation.
public boolean isOutlineRowButtonsBelow()
This value is simply written to Excel file and has no effect on behavior of this library. For more information on worksheet protection, consult Microsoft Excel documentation.
public boolean isShowColumnsFromRightToLeft()
Default value is false
.
public boolean isShowFormulas()
Default value is false
.
public boolean isShowGridLines()
Default value is true
.
public boolean isShowInPageBreakPreview()
Default value is false
.
public boolean isShowOutlineSymbols()
Default value is true
.
public boolean isShowSheetHeaders()
Default value is true
.
public boolean isShowZeroValues()
Default value is true
.
public void setFirstVisibleColumn(int firstVisibleColumn)
Default value is 0.
public void setFirstVisibleRow(int firstVisibleRow)
Default value is 0.
public void setOutlineColumnButtonsRight(boolean outlineColumnButtonsRight)
This value is simply written to Excel file and has no effect on behavior of this library. For more information on worksheet protection, consult Microsoft Excel documentation.
public void setOutlineRowButtonsBelow(boolean outlineRowButtonsBelow)
This value is simply written to Excel file and has no effect on behavior of this library. For more information on worksheet protection, consult Microsoft Excel documentation.
Following code creates two horizontal groups and one vertical group. Horizontal groups have outline button above (default is below), while vertical group is collapsed.
public static void groupingAndOutline(ExcelWorksheet ws) {
ws.getCell(0, 0).setValue("Grouping and outline example:");
//Vertical grouping.
ws.getCell(2, 0).setValue("GroupA Start");
ws.getRow(2).setOutlineLevel(1);
ws.getCell(3, 0).setValue("A");
ws.getRow(3).setOutlineLevel(1);
ws.getCell(4, 1).setValue("GroupB Start");
ws.getRow(4).setOutlineLevel(2);
ws.getCell(5, 1).setValue("B");
ws.getRow(5).setOutlineLevel(2);
ws.getCell(6, 1).setValue("GroupB End");
ws.getRow(6).setOutlineLevel(2);
ws.getCell(7, 0).setValue("GroupA End");
ws.getRow(7).setOutlineLevel(1);
// Put outline row buttons above groups.
ws.getViewOptions().setOutlineRowButtonsBelow(false);
//Horizontal grouping (collapsed).
ws.getCell("E2").setValue("Gr.C Start");
ws.getColumns().get("E").setOutlineLevel(1);
ws.getColumns().get("E").setHidden(true);
ws.getCell("F2").setValue("C");
ws.getColumns().get("F").setOutlineLevel(1);
ws.getColumns().get("F").setHidden(true);
ws.getCell("G2").setValue("Gr.C End");
ws.getColumns().get("G").setOutlineLevel(1);
ws.getColumns().get("G").setHidden(true);
ws.getColumns().get("H").setCollapsed(true);
}
public void setPageBreakViewZoom(int zoom)
Unit is one percent. Value must be between 10 and 400.
Default value is 60.
This method is not supported when exporting to XLS file format.
IndexOutOfBoundsException
- Value is out of 10 to 400 range.public void setShowColumnsFromRightToLeft(boolean showColumnsFromRightToLeft)
Default value is false
.
public void setShowFormulas(boolean showFormulas)
Default value is false
.
public void setShowGridLines(boolean showGridLines)
Default value is true
.
public void setShowInPageBreakPreview(boolean showInPageBreakPreview)
Default value is false
.
This method is not supported when exporting to XLS file format.
public void setShowOutlineSymbols(boolean showOutlineSymbols)
Default value is true
.
This method is not supported when exporting to XLS file format.
public void setShowSheetHeaders(boolean showSheetHeaders)
Default value is true
.
public void setShowZeroValues(boolean showZeroValues)
Default value is true
.
public void setViewType(ViewType viewType)
Default value is ViewType.Normal
.
View type is supported only for XLSX (Excel 2007+) files.
public void setZoom(int zoom)
Unit is one percent. Value must be between 10 and 400.
Default value is 100.
IndexOutOfBoundsException
- Value is out of 10 to 400 range.© GemBox Ltd. — All rights reserved.