接口 IWorksheet


public interface IWorksheet
Represents a worksheet.
  • 方法详细资料

    • 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

      void setVisible(Visibility value)
      Sets whether the object is visible.
    • getActiveCell

      IRange getActiveCell()
      Gets the active cell.
    • getAutoFilter

      IAutoFilter getAutoFilter()
      Returns an IAutoFilter 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 the IRange object that represents all the columns on thespecified worksheet.
    • getCells

      IRange getCells()
      Returns the IRange object that represents all the cells on theworksheet (not just the cells that are currently in use).
    • getComments

      IComments getComments()
      Returns the IComments collection that represents all the comments forthe specified worksheet.
    • getCommentsThreaded

      ICommentsThreaded getCommentsThreaded()
      Returns the ICommentsThreaded 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

      void setName(String value)
      Sets the name of the object.
    • getNames

      INames getNames()
      Returns the INames collection that represents all theworksheet-specific names (names defined with the "WorksheetName!" prefix).
    • getOutline

      IOutline getOutline()
      Returns an IOutline 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 a IPivotTables object or a collection of all the PivotTables reportIPivotTables object on a worksheet.
    • getRange

      IRange getRange(String reference)
      Gets the IRange object with the specified reference.
      参数:
      reference - The reference.
      返回:
      the range.
    • getRange

      IRange getRange(int row, int column)
      Gets the IRange object with the specified row and column.
      参数:
      row - The row.
      column - The column.
      返回:
      the range.
    • getRange

      IRange getRange(int row, int column, int rowCount, int columnCount)
      Gets the IRange 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 a IShapes object that represents all the shapes on theworksheet or chart sheet.
    • getBackgroundPictures

      IBackgroundPictures getBackgroundPictures()
      Returns a IBackgroundPictures 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

      void setTabColor(Color value)
      Sets the primary color of the tab.
    • getTables

      ITables getTables()
      Returns a collection of ITable objects in the worksheet.
    • getWorkbook

      IWorkbook getWorkbook()
      Returns the workbook.
    • getProtectionSettings

      IProtectionSettings getProtectionSettings()
      Returns the IProtectionSettings 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 the IRange 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

      void setFrozenLineColor(Color value)
      Sets the color of frozen line.
    • getSplitRow

      int getSplitRow()
      Gets the split row.
    • getSplitColumn

      int getSplitColumn()
      Gets the split column.
    • getPageSetup

      IPageSetup getPageSetup()
      Returns a IPageSetup 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

      Object evaluate(String formula)
      Converts a Microsoft Excel name to an object or a value.
      参数:
      formula - Required String. The name of the object, using the namingconvention.
    • evaluate

      Object evaluate(String formula, IFormulaResolver resolver)
      参数:
      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 the IPane object that represents the active pane of the worksheet.
    • save

      void save(String fileName)
      Saves current worksheet to the specified file.
      参数:
      fileName - The specified file name.
    • save

      void save(String fileName, SaveFileFormat fileFormat)
      Saves current worksheet to the specified format file.
      参数:
      fileName - The specified file.
      fileFormat - The format of the file.
    • save

      void save(OutputStream fileStream, SaveFileFormat fileFormat)
      Saves current worksheet to the specified format file stream.
      参数:
      fileStream - The specified file stream.
      fileFormat - The format of the file stream.
    • save

      void save(String fileName, SaveOptionsBase options)
      Saves current worksheet to the specified file.
      参数:
      fileName - The specified file.
      options - The options of saving the file.
    • save

      void save(OutputStream fileStream, SaveOptionsBase options)
      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

      void setTag(Object tag)
      Sets the tag for sheet.
    • getCellType

      BaseCellType getCellType()
      Gets the cell type for sheet.
    • setCellType

      void setCellType(BaseCellType cellType)
      Sets the cell type for sheet.
    • getDataSource

      Object getDataSource()
      Gets the data source of data binding for current sheet.
    • setDataSource

      void setDataSource(Object value)
      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

      IWorksheet copy(IWorkbook workbook)
      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

      IWorksheet copyBefore(IWorksheet targetSheet)
      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

      IWorksheet copyAfter(IWorksheet targetSheet)
      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

      IWorksheet move(IWorkbook workbook)
      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

      IWorksheet moveBefore(IWorksheet targetSheet)
      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

      IWorksheet moveAfter(IWorksheet targetSheet)
      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

      String toJson(SerializationOptions serializationOptions)
      Generates a json string from the worksheet.
      参数:
      serializationOptions - the SerializationOptions object.
      返回:
      The json string
    • toJson

      void toJson(OutputStream stream)
      Generates a json stream from the worksheet.
      参数:
      stream - the output stream.
    • toJson

      void toJson(OutputStream stream, SerializationOptions serializationOptions)
      Generates a json stream from the worksheet.
      参数:
      stream - the output stream.
      serializationOptions - the SerializationOptions object.
    • fromJson

      void fromJson(String json)
      Generates a worksheet from the json string.
      参数:
      json - the input json string.
    • fromJson

      void fromJson(String json, DeserializationOptions deserializationOptions)
      参数:
      json - the input json string.
      deserializationOptions - the DeserializationOptions object.
    • fromJson

      void fromJson(InputStream stream)
      Generates a worksheet from the json stream.
      参数:
      stream - the input json stream.
    • fromJson

      void fromJson(InputStream stream, DeserializationOptions deserializationOptions)
      参数:
      stream - the input json stream.
      deserializationOptions - the DeserializationOptions object.
    • toImage

      void toImage(String imageFile)
      Saves the sheet to the specified image file.
      参数:
      imageFile - The output image file.
    • toImage

      void toImage(String imageFile, ImageSaveOptions options)
      Saves the sheet to the specified image file using options.
      参数:
      imageFile - The output image file.
      options - The options for output image.
    • toImage

      void toImage(OutputStream stream, ImageType imageType)
      Saves the sheet to the specified image file.
      参数:
      stream - The output image stream.
      imageType - Specifies the type of image to create.
    • toImage

      void toImage(OutputStream stream, ImageType imageType, ImageSaveOptions options)
      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

      void protect(String password)
      Protects a worksheet so that it cannot be modified.
      参数:
      password - Password to protect the worksheet.
    • unprotect

      void unprotect()
      Removes protection from the worksheet.
    • unprotect

      void unprotect(String password)
      Removes protection from the worksheet.
      参数:
      password - Password to protect the worksheet.