public interface Worksheet
Modifier and Type | Interface and Description |
---|---|
static class |
Worksheet.Visibility
Visibility attributes that can be applied.
|
Modifier and Type | Method and Description |
---|---|
void |
activate()
Activates the worksheet
|
Worksheet |
copyTo(int index)
Copies this sheet to this workbook at the given index, with a default
name.
|
Worksheet |
copyTo(Workbook workbook,
int index)
Copies this sheet to the workbook at the given index, with a default
name.
|
Worksheet |
copyToEnd()
Copies this sheet to the end of this workbook, with a default name.
|
Worksheet |
copyToEnd(Workbook workbook)
Copies this sheet to the end of the workbook, with a default name.
|
String |
getBookName()
Returns the workbook name
|
Button |
getButton(int index)
Returns the control button of the given index.
|
Button |
getButton(String nameOrShapeId)
Returns the control button of the given name or shapeId.
|
Checkbox |
getCheckbox(int index)
Returns the control checkbox of the given index.
|
Checkbox |
getCheckbox(String nameOrShapeId)
Returns the control checkbox of the given name or shapeId.
|
List<DataValidationValue> |
getDataValidations()
Returns the data validations of this worksheet from the remote data server.
|
int |
getFirstColumn(int row)
Returns the first column of row which contains data
|
int |
getFirstRow()
Returns the first row which contains data of this sheet
|
Groupbox |
getGroupbox(int index)
Returns the control groupbox of the given index.
|
Groupbox |
getGroupbox(String nameOrShapeId)
Returns the control groupbox of the given name or shapeId.
|
int |
getIndex()
Returns the sheet index.
|
int |
getLastColumn(int row)
Returns the last column of row which contains data
|
int |
getLastRow()
Returns the last row which contains data of this sheet
|
String |
getName()
Returns the sheet name.
|
OptionButton |
getOptionButton(int index)
Returns the control option button of the given index.
|
OptionButton |
getOptionButton(String nameOrShapeId)
Returns the control option button of the given name or shapeId.
|
Range |
getRange(int row,
int column)
Returns the range with the given row and column.
|
Range |
getRange(int row,
int column,
int numRows,
int numColumns)
Returns the range with the given row and column with the given number
of the rows and columns
|
Range |
getRange(String a1Notation)
Returns the range with the given A1 notation or R1C1 notation.
|
String |
getSheetId()
Returns the uuid of this worksheet.
|
Spreadsheet |
getSpreadsheet()
Returns the spreadsheet which holds this worksheet.
|
Worksheet.Visibility |
getVisible()
Returns the visibility of this sheet.
|
Workbook |
getWorkbook()
Returns the workbook which holds this worksheet.
|
boolean |
isProtected()
Returns true if the sheet is protected.
|
void |
protect(String password,
boolean drawingObjects,
boolean contents,
boolean scenarios,
boolean userInterfaceOnly,
boolean allowFormattingCells,
boolean allowFormattingColumns,
boolean allowFormattingRows,
boolean allowInsertingColumns,
boolean allowInsertingRows,
boolean allowInsertingHyperlinks,
boolean allowDeletingColumns,
boolean allowDeletingRows,
boolean allowSorting,
boolean allowFiltering,
boolean allowUsingPivotTables)
Protects this sheet so that it cannot be modified.
|
void |
rename(String newName)
Renames the sheet name.
|
void |
setVisible(Worksheet.Visibility visibility)
Sets the visibility of this sheet.
|
boolean |
unprotect(String password)
Removes protection to this sheet.
|
String getSheetId()
int getIndex()
String getBookName()
Spreadsheet getSpreadsheet()
Workbook getWorkbook()
Range getRange(String a1Notation)
a1Notation
- Range getRange(int row, int column)
row
- the starting row index of the rangecolumn
- the starting column index of the range.Range getRange(int row, int column, int numRows, int numColumns)
row
- the starting row index of the rangecolumn
- the starting column index of the rangenumRows
- the number of the rowsnumColumns
- the number of the columnsvoid setVisible(Worksheet.Visibility visibility)
visibility
- either Worksheet.Visibility.Visible
, Worksheet.Visibility.Hidden
,
or Worksheet.Visibility.VeryHidden
Worksheet.Visibility getVisible()
String getName()
void rename(String newName)
newName
- void activate()
Worksheet copyToEnd()
Worksheet copyTo(int index)
index
- the sheet index in the workbook where the copied placed.Worksheet copyToEnd(Workbook workbook)
workbook
- the workbook which this sheet copies to.Worksheet copyTo(Workbook workbook, int index)
workbook
- the workbook which this sheet copies to.index
- the index in the workbook where the copied sheet placed.List<DataValidationValue> getDataValidations()
int getFirstRow()
int getLastRow()
int getFirstColumn(int row)
row
- int getLastColumn(int row)
row
- void protect(String password, boolean drawingObjects, boolean contents, boolean scenarios, boolean userInterfaceOnly, boolean allowFormattingCells, boolean allowFormattingColumns, boolean allowFormattingRows, boolean allowInsertingColumns, boolean allowInsertingRows, boolean allowInsertingHyperlinks, boolean allowDeletingColumns, boolean allowDeletingRows, boolean allowSorting, boolean allowFiltering, boolean allowUsingPivotTables)
unprotect(String password)
.
change the protection options; make sure providepassword
- a case-sensitive password for the sheet; null or empty string means protect the sheet without password.drawingObjects
- true to protect objects; default to true.contents
- true to protect contents; default to true.scenarios
- true to protect scenarios; default to true.userInterfaceOnly
- true to protect the user interface only; default to false.allowFormattingCells
- true to allow user to format any cell on the protected sheet; default to false.allowFormattingColumns
- true to allow user to format any columns on the protected sheet; default to false.allowFormattingRows
- true to allow user to format any rows on the protected sheet; default to false.allowInsertingColumns
- true to allow user to insert columns on the protected sheet; default to false.allowInsertingRows
- true to allow user to insert rows on the protected sheet; default false.allowInsertingHyperlinks
- true to allow user to insert hyperlinks on the protected sheet; default to false.allowDeletingColumns
- true to allow user to delete columns on the protected sheet; default to false.allowDeletingRows
- true to allow user to delete rows on the protected sheet; default to false.allowSorting
- true to allow user to sort on the protected sheet; default to false.allowFiltering
- true to allow user to set filters on the protected sheet; default to false.allowUsingPivotTables
- true to allow user to use pivot table reports on the protected sheet; default to false.unprotect(String password)
boolean unprotect(String password)
password
- a case-sensitive password used to unprotect the sheet. If
the sheet isn't protected with a password, this argument is ignored. If you
omit this argument for a sheet that is protected with a password, you'll be
prompted for the password.boolean isProtected()
Button getButton(String nameOrShapeId)
Button getButton(int index)
Checkbox getCheckbox(String nameOrShapeId)
Checkbox getCheckbox(int index)
OptionButton getOptionButton(String nameOrShapeId)
OptionButton getOptionButton(int index)
Groupbox getGroupbox(String nameOrShapeId)
Groupbox getGroupbox(int index)
Copyright © 2018. All rights reserved.