接口 IWorksheet
public interface IWorksheet
Represents a worksheet.
-
方法概要
修饰符和类型方法说明void
activate()
Makes the current sheet the active sheet.copy()
Copies the sheet to the end of the current workbook.Copies the sheet to the end of the specified workbook.copyAfter
(IWorksheet targetSheet) Copies the sheet to the location after the specified sheet.copyBefore
(IWorksheet targetSheet) Copies the sheet to the location before the specified sheet.void
delete()
Deletes the object.Converts a Microsoft Excel name to an object or a value.evaluate
(String formula, IFormulaResolver resolver) void
freezePanes
(int row, int column) Freezes panes at the specified position.void
freezeTrailingPanes
(int row, int column) Freezes trailing panes at the specified position.void
fromJson
(InputStream stream) Generates a worksheet from the json stream.void
fromJson
(InputStream stream, DeserializationOptions deserializationOptions) void
Generates a worksheet from the json string.void
fromJson
(String json, DeserializationOptions deserializationOptions) Gets the active cell.Returns theIPane
object that represents the active pane of the worksheet.Returns anIAutoFilter
object if filtering is on.boolean
Gets whether the AutoFilter drop-down arrows are currently displayed on the sheet.boolean
Gets whether to generate columns automatically while binding data.byte[]
Gets the background graphic for this worksheet.Returns aIBackgroundPictures
object that represents all the backgound pictures on theworksheet or chart sheet.getCells()
Returns theIRange
object that represents all the cells on theworksheet (not just the cells that are currently in use).Gets the cell type for sheet.int
Gets the column count of the worksheet when exported to json.Returns theIRange
object that represents all the columns on thespecified worksheet.Returns theIComments
collection that represents all the comments forthe specified worksheet.Returns theICommentsThreaded
collection that represents all the threaded comments forthe specified worksheet.Gets the control collection of this worksheet.Gets the data source of data binding for current sheet.boolean
Gets whether the worksheet is in filter mode.boolean
Gets whether the horizontal and vertical page breaks are fixed when inserting/deleting rows/columns.int
Gets the frozen column.int
Gets the frozen row.int
Gets the number of trailing frozen columns of the sheet.int
Gets the number of trailing frozen rows of the sheet.Gets the color of frozen line.Get the collection of horizontal page breaks within the print area.Provides access to the collection of Hyperlinks contained in the worksheet.int
getIndex()
Gets the index number of the object within the collection of similar objects.getName()
Gets the name of the object.getNames()
Returns theINames
collection that represents all theworksheet-specific names (names defined with the "WorksheetName!"Returns anIOutline
object that represents the outline for thespecified worksheet.Gets the outline column for the worksheet.Returns aIPageSetup
object that contains all the page setup settingsfor the specified object.getPanes()
Worksheet panes.Returns an object that represents either a single PivotTable report aIPivotTables
object or a collection of all the PivotTables reportIPivotTables
object on a worksheet.boolean
Gets the protection status of the worksheet.Returns theIProtectionSettings
object that represents the protectionoptions of the worksheet.getRange
(int row, int column) Gets theIRange
object with the specified row and column.getRange
(int row, int column, int rowCount, int columnCount) Gets theIRange
object with the specified row and column.Gets theIRange
object with the specified reference.int
Gets the row count of the worksheet when exported to json.getRows()
Returns theIRange
object that represents all the rows on thespecified worksheet.Gets the selection range.Returns aIShapes
object that represents all the shapes on theworksheet or chart sheet.Returns an object that represents the view settings of this worksheet.boolean
Gets whether to display the column outline.boolean
Gets whether to display the row outline.getSort()
Returns the sorted values in the current worksheet.int
Gets the split column.int
Gets the split row.double
Gets the standard (default) height(in points) of all the rows in the worksheet in points.double
Gets the standard (default) height(in pixels) of all the rows in the worksheet in points.double
Gets the standard (default) width(in points) of all the columns in the worksheet.double
Gets the standard (default) width(in pixels) of all the columns in the worksheet.Gets the primary color of the tab.Returns a collection ofITable
objects in the worksheet.getTag()
Gets the tag of sheet.getType()
Gets the sheet's type.Gets the used range, its behavior is equivalent to getUsedRange(EnumSet.of(UsedRangeType.Axis, UsedRangeType.Data, UsedRangeType.Comment, UsedRangeType.Style, UsedRangeType.Merge))Gets whether the object is visible.Get the collection of vertical page breaks within the print area.Returns the workbook.move()
Moves the sheet to the end of the current workbook.Moves the sheet to the end of the specified workbook.moveAfter
(IWorksheet targetSheet) Moves the sheet to the location after the specified sheet.moveBefore
(IWorksheet targetSheet) Moves the sheet to the location before the specified sheet.void
protect()
Protects a worksheet so that it cannot be modified.void
Protects a worksheet so that it cannot be modified.void
save
(OutputStream fileStream, SaveFileFormat fileFormat) Saves current worksheet to the specified format file stream.void
save
(OutputStream fileStream, SaveOptionsBase options) Saves current worksheet to the specified file stream.void
Saves current worksheet to the specified file.void
save
(String fileName, SaveFileFormat fileFormat) Saves current worksheet to the specified format file.void
save
(String fileName, SaveOptionsBase options) Saves current worksheet to the specified file.void
select()
Selects the object.void
select
(boolean replace) Selects the object.void
setAutoFilterMode
(boolean value) Sets whether the AutoFilter drop-down arrows are currently displayed on the sheet.void
setAutoGenerateColumns
(boolean value) Sets whether to generate columns automatically while binding data.void
setBackgroundPicture
(byte[] picture) Sets the background graphic for this worksheet.void
setCellType
(BaseCellType cellType) Sets the cell type for sheet.void
setColumnCount
(int value) Sets the column count of the worksheet when exported to json.void
setDataSource
(Object value) Sets the data source of data binding for current sheet.void
setFixedPageBreaks
(boolean value) Sets whether the horizontal and vertical page breaks are fixed when inserting/deleting rows/columns.void
setFrozenLineColor
(Color value) Sets the color of frozen line.void
setIndex
(int value) Sets the index number of the object within the collection of similar objects.void
Sets the name of the object.void
setProtection
(boolean value) Sets the protection status of the worksheet.void
setRowCount
(int value) Sets the row count of the worksheet when exported to json.void
setShowColumnOutline
(boolean value) Sets whether to display the column outline.void
setShowRowOutline
(boolean value) Sets whether to display the row outline.void
setStandardHeight
(double value) Sets the standard (default) height(in points) of all the rows in the worksheet in points.void
setStandardHeightInPixel
(double value) Sets the standard (default) height(in pixels) of all the rows in the worksheet in points.void
setStandardWidth
(double value) Sets the standard (default) width(in points) of all the columns in the worksheet.void
setStandardWidthInPixel
(double value) Sets the standard (default) width(in pixels) of all the columns in the worksheet.void
setTabColor
(Color value) Sets the primary color of the tab.void
Sets the tag for sheet.void
setVisible
(Visibility value) Sets whether the object is visible.void
Makes all rows of the currently filtered list visible.void
splitPanes
(int row, int column) Splits panes at the specified position.void
toImage
(OutputStream stream, ImageType imageType) Saves the sheet to the specified image file.void
toImage
(OutputStream stream, ImageType imageType, ImageSaveOptions options) Saves the sheet to the specified image file using options.void
Saves the sheet to the specified image file.void
toImage
(String imageFile, ImageSaveOptions options) Saves the sheet to the specified image file using options.toJson()
Generates a json string from the worksheet.toJson
(SerializationOptions serializationOptions) Generates a json string from the worksheet.void
toJson
(OutputStream stream) Generates a json stream from the worksheet.void
toJson
(OutputStream stream, SerializationOptions serializationOptions) Generates a json stream from the worksheet.void
Unfreezes panes.void
Unfreezes trailing panes.void
Removes protection from the worksheet.void
Removes protection from the worksheet.void
Unsplits panes.
-
方法详细资料
-
getControls
IControlCollection getControls()Gets the control collection of this worksheet. -
getSheetView
IWorksheetView getSheetView()Returns an object that represents the view settings of this worksheet. -
getVisible
Visibility getVisible()Gets whether the object is visible. -
setVisible
Sets whether the object is visible. -
getActiveCell
IRange getActiveCell()Gets the active cell. -
getAutoFilter
IAutoFilter getAutoFilter()Returns anIAutoFilter
object if filtering is on. Returns nothing iffiltering is off. -
getAutoFilterMode
boolean getAutoFilterMode()Gets whether the AutoFilter drop-down arrows are currently displayed on the sheet. -
setAutoFilterMode
void setAutoFilterMode(boolean value) Sets whether the AutoFilter drop-down arrows are currently displayed on the sheet. -
getColumns
IRange getColumns()Returns theIRange
object that represents all the columns on thespecified worksheet. -
getCells
IRange getCells()Returns theIRange
object that represents all the cells on theworksheet (not just the cells that are currently in use). -
getComments
IComments getComments()Returns theIComments
collection that represents all the comments forthe specified worksheet. -
getCommentsThreaded
ICommentsThreaded getCommentsThreaded()Returns theICommentsThreaded
collection that represents all the threaded comments forthe specified worksheet. -
getStandardWidth
double getStandardWidth()Gets the standard (default) width(in points) of all the columns in the worksheet. -
getStandardWidthInPixel
double getStandardWidthInPixel()Gets the standard (default) width(in pixels) of all the columns in the worksheet. -
setStandardWidth
void setStandardWidth(double value) Sets the standard (default) width(in points) of all the columns in the worksheet. -
setStandardWidthInPixel
void setStandardWidthInPixel(double value) Sets the standard (default) width(in pixels) of all the columns in the worksheet. -
getStandardHeight
double getStandardHeight()Gets the standard (default) height(in points) of all the rows in the worksheet in points. -
getStandardHeightInPixel
double getStandardHeightInPixel()Gets the standard (default) height(in pixels) of all the rows in the worksheet in points. -
setStandardHeight
void setStandardHeight(double value) Sets the standard (default) height(in points) of all the rows in the worksheet in points. -
setStandardHeightInPixel
void setStandardHeightInPixel(double value) Sets the standard (default) height(in pixels) of all the rows in the worksheet in points. -
getFilterMode
boolean getFilterMode()Gets whether the worksheet is in filter mode. -
getHyperlinks
IHyperlinks getHyperlinks()Provides access to the collection of Hyperlinks contained in the worksheet. -
getIndex
int getIndex()Gets the index number of the object within the collection of similar objects. -
setIndex
void setIndex(int value) Sets the index number of the object within the collection of similar objects. -
getRowCount
int getRowCount()Gets the row count of the worksheet when exported to json. -
setRowCount
void setRowCount(int value) Sets the row count of the worksheet when exported to json. -
getColumnCount
int getColumnCount()Gets the column count of the worksheet when exported to json. -
setColumnCount
void setColumnCount(int value) Sets the column count of the worksheet when exported to json. -
getBackgroundPicture
byte[] getBackgroundPicture()Gets the background graphic for this worksheet. -
setBackgroundPicture
void setBackgroundPicture(byte[] picture) Sets the background graphic for this worksheet. -
getName
String getName()Gets the name of the object. -
setName
Sets the name of the object. -
getNames
INames getNames()Returns theINames
collection that represents all theworksheet-specific names (names defined with the "WorksheetName!" prefix). -
getOutline
IOutline getOutline()Returns anIOutline
object that represents the outline for thespecified worksheet. -
getShowRowOutline
boolean getShowRowOutline()Gets whether to display the row outline. The default value is true, and this property only applies when interacting with SJS. -
setShowRowOutline
void setShowRowOutline(boolean value) Sets whether to display the row outline. The default value is true, and this property only applies when interacting with SJS.. -
getShowColumnOutline
boolean getShowColumnOutline()Gets whether to display the column outline. The default value is true, and this property only applies when interacting with SJS. -
setShowColumnOutline
void setShowColumnOutline(boolean value) Sets whether to display the column outline. The default value is true, and this property only applies when interacting with SJS.. -
getPivotTables
IPivotTables getPivotTables()Returns an object that represents either a single PivotTable report aIPivotTables
object or a collection of all the PivotTables reportIPivotTables
object on a worksheet. -
getRange
Gets theIRange
object with the specified reference.- 参数:
reference
- The reference.- 返回:
- the range.
-
getRange
Gets theIRange
object with the specified row and column.- 参数:
row
- The row.column
- The column.- 返回:
- the range.
-
getRange
Gets theIRange
object with the specified row and column.- 参数:
row
- The row.column
- The column.rowCount
- The row count.columnCount
- The column count.- 返回:
- the range.
-
getSelection
IRange getSelection()Gets the selection range. -
getShapes
IShapes getShapes()Returns aIShapes
object that represents all the shapes on theworksheet or chart sheet. -
getBackgroundPictures
IBackgroundPictures getBackgroundPictures()Returns aIBackgroundPictures
object that represents all the backgound pictures on theworksheet or chart sheet. -
getSort
ISort getSort()Returns the sorted values in the current worksheet. -
getTabColor
Color getTabColor()Gets the primary color of the tab. -
setTabColor
Sets the primary color of the tab. -
getTables
ITables getTables()Returns a collection ofITable
objects in the worksheet. -
getWorkbook
IWorkbook getWorkbook()Returns the workbook. -
getProtectionSettings
IProtectionSettings getProtectionSettings()Returns theIProtectionSettings
object that represents the protectionoptions of the worksheet. -
getProtection
boolean getProtection()Gets the protection status of the worksheet. -
setProtection
void setProtection(boolean value) Sets the protection status of the worksheet. -
getRows
IRange getRows()Returns theIRange
object that represents all the rows on thespecified worksheet. -
getFreezeRow
int getFreezeRow()Gets the frozen row. -
getFreezeColumn
int getFreezeColumn()Gets the frozen column. -
getFrozenLineColor
Color getFrozenLineColor()Gets the color of frozen line. -
getFreezeTrailingRow
int getFreezeTrailingRow()Gets the number of trailing frozen rows of the sheet. -
getFreezeTrailingColumn
int getFreezeTrailingColumn()Gets the number of trailing frozen columns of the sheet. -
setFrozenLineColor
Sets the color of frozen line. -
getSplitRow
int getSplitRow()Gets the split row. -
getSplitColumn
int getSplitColumn()Gets the split column. -
getPageSetup
IPageSetup getPageSetup()Returns aIPageSetup
object that contains all the page setup settingsfor the specified object. -
getHPageBreaks
IHPageBreaks getHPageBreaks()Get the collection of horizontal page breaks within the print area. -
getVPageBreaks
IVPageBreaks getVPageBreaks()Get the collection of vertical page breaks within the print area. -
select
void select()Selects the object. -
select
void select(boolean replace) Selects the object.- 参数:
replace
- True to replace the current selection withthe specified object. False to extend the current selection to include any previously selected objects and the specified object.
-
activate
void activate()Makes the current sheet the active sheet. This is equivalent to clicking the sheet's tab. -
delete
void delete()Deletes the object. -
evaluate
Converts a Microsoft Excel name to an object or a value.- 参数:
formula
- Required String. The name of the object, using the namingconvention.
-
evaluate
- 参数:
formula
-resolver
-- 返回:
-
showAllData
void showAllData()Makes all rows of the currently filtered list visible. If AutoFilter is in use, this method changes the arrows to "All." -
getUsedRange
IRange getUsedRange()Gets the used range, its behavior is equivalent to getUsedRange(EnumSet.of(UsedRangeType.Axis, UsedRangeType.Data, UsedRangeType.Comment, UsedRangeType.Style, UsedRangeType.Merge)) -
freezePanes
void freezePanes(int row, int column) Freezes panes at the specified position.- 参数:
row
- The frozen row position.column
- The frozen column position.
-
unfreezePanes
void unfreezePanes()Unfreezes panes. -
freezeTrailingPanes
void freezeTrailingPanes(int row, int column) Freezes trailing panes at the specified position.- 参数:
row
- The trailing frozen row position.column
- The trailing frozen column position.
-
unfreezeTrailingPanes
void unfreezeTrailingPanes()Unfreezes trailing panes. -
splitPanes
void splitPanes(int row, int column) Splits panes at the specified position.- 参数:
row
- The split row position.column
- The split column position.
-
unsplitPanes
void unsplitPanes()Unsplits panes. -
getPanes
IPanes getPanes()Worksheet panes. -
getActivePane
IPane getActivePane()Returns theIPane
object that represents the active pane of the worksheet. -
save
Saves current worksheet to the specified file.- 参数:
fileName
- The specified file name.
-
save
Saves current worksheet to the specified format file.- 参数:
fileName
- The specified file.fileFormat
- The format of the file.
-
save
Saves current worksheet to the specified format file stream.- 参数:
fileStream
- The specified file stream.fileFormat
- The format of the file stream.
-
save
Saves current worksheet to the specified file.- 参数:
fileName
- The specified file.options
- The options of saving the file.
-
save
Saves current worksheet to the specified file stream.- 参数:
fileStream
- The specified file stream.options
- The options of saving the file stream.
-
getFixedPageBreaks
boolean getFixedPageBreaks()Gets whether the horizontal and vertical page breaks are fixed when inserting/deleting rows/columns. -
setFixedPageBreaks
void setFixedPageBreaks(boolean value) Sets whether the horizontal and vertical page breaks are fixed when inserting/deleting rows/columns. -
getType
SheetType getType()Gets the sheet's type. -
getTag
Object getTag()Gets the tag of sheet. -
setTag
Sets the tag for sheet. -
getCellType
BaseCellType getCellType()Gets the cell type for sheet. -
setCellType
Sets the cell type for sheet. -
getDataSource
Object getDataSource()Gets the data source of data binding for current sheet. -
setDataSource
Sets the data source of data binding for current sheet. -
getAutoGenerateColumns
boolean getAutoGenerateColumns()Gets whether to generate columns automatically while binding data. -
setAutoGenerateColumns
void setAutoGenerateColumns(boolean value) Sets whether to generate columns automatically while binding data. -
getOutlineColumn
IOutlineColumn getOutlineColumn()Gets the outline column for the worksheet. -
copy
IWorksheet copy()Copies the sheet to the end of the current workbook.- 返回:
- The new copied sheet
-
copy
Copies the sheet to the end of the specified workbook.- 参数:
workbook
- Specifies the workbook to which the sheet will be copied.- 返回:
- The new copied sheet
-
copyBefore
Copies the sheet to the location before the specified sheet.- 参数:
targetSheet
- The sheet before which the copied sheet will be placed. It can be the sheet of the same or another workbook.- 返回:
- The new copied sheet
-
copyAfter
Copies the sheet to the location after the specified sheet.- 参数:
targetSheet
- The sheet after which the copied sheet will be placed. It can be the sheet of the same or another workbook.- 返回:
- The new copied sheet
-
move
IWorksheet move()Moves the sheet to the end of the current workbook.- 返回:
- The moved sheet
-
move
Moves the sheet to the end of the specified workbook.- 参数:
workbook
- Specifies the workbook to which the sheet will be moved.- 返回:
- The moved sheet
-
moveBefore
Moves the sheet to the location before the specified sheet.- 参数:
targetSheet
- The sheet before which the moved sheet will be placed. It can be the sheet of the same or another workbook.- 返回:
- The moved sheet
-
moveAfter
Moves the sheet to the location after the specified sheet.- 参数:
targetSheet
- The sheet after which the moved sheet will be placed. It can be the sheet of the same or another workbook.- 返回:
- The moved sheet
-
toJson
String toJson()Generates a json string from the worksheet. -
toJson
Generates a json string from the worksheet.- 参数:
serializationOptions
- theSerializationOptions
object.- 返回:
- The json string
-
toJson
Generates a json stream from the worksheet.- 参数:
stream
- the output stream.
-
toJson
Generates a json stream from the worksheet.- 参数:
stream
- the output stream.serializationOptions
- theSerializationOptions
object.
-
fromJson
Generates a worksheet from the json string.- 参数:
json
- the input json string.
-
fromJson
- 参数:
json
- the input json string.deserializationOptions
- theDeserializationOptions
object.
-
fromJson
Generates a worksheet from the json stream.- 参数:
stream
- the input json stream.
-
fromJson
- 参数:
stream
- the input json stream.deserializationOptions
- theDeserializationOptions
object.
-
toImage
Saves the sheet to the specified image file.- 参数:
imageFile
- The output image file.
-
toImage
Saves the sheet to the specified image file using options.- 参数:
imageFile
- The output image file.options
- The options for output image.
-
toImage
Saves the sheet to the specified image file.- 参数:
stream
- The output image stream.imageType
- Specifies the type of image to create.
-
toImage
Saves the sheet to the specified image file using options.- 参数:
stream
- The output image stream.imageType
- Specifies the type of image to create.options
- The options for output image.
-
protect
void protect()Protects a worksheet so that it cannot be modified. -
protect
Protects a worksheet so that it cannot be modified.- 参数:
password
- Password to protect the worksheet.
-
unprotect
void unprotect()Removes protection from the worksheet. -
unprotect
Removes protection from the worksheet.- 参数:
password
- Password to protect the worksheet.
-