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
|
String |
getBookName()
Returns the workbook name
|
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
|
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.
|
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()
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()
Copyright © 2018. All rights reserved.