接口 IWorkbook

所有已知实现类:
Workbook

public interface IWorkbook
Represents an IWorkbook object.
  • 方法详细资料

    • getAllowDynamicArray

      @Deprecated boolean getAllowDynamicArray()
      已过时。
      Gets whether allow dynamic array formula.This method is obsoleted, please use getFormula2() to get dynamic array formula.
    • setAllowDynamicArray

      @Deprecated void setAllowDynamicArray(boolean value)
      已过时。
      Sets whether allow dynamic array formula.This method is obsoleted, please use setFormula2() to set dynamic array formula.
    • getDeferUpdateDirtyState

      boolean getDeferUpdateDirtyState()
      Gets whether update the dirty state of the formula cells immediately when changing the value of a cell.
    • setDeferUpdateDirtyState

      void setDeferUpdateDirtyState(boolean value)
      Sets whether update the dirty state of the formula cells immediately when changing the value of a cell.
    • getName

      String getName()
      Gets a string value that represents the name of the workbook.
    • setName

      void setName(String name)
      Sets a string value that represents the name of the workbook.
    • getFullName

      String getFullName()
      Returns the name of the workbook, including its path on disk.
    • getPath

      String getPath()
      Gets a string that represents the path to the workbook file that this workbook object represents.
    • setPath

      void setPath(String path)
      Sets a string that represents the path to the workbook file that this workbook object represents.
    • getSelectedSheets

      IWorksheets getSelectedSheets()
      Returns a IWorksheets collectionthat represents all the selected sheets in the specified workbook.
    • getOptions

      IExcelOptions getOptions()
      Returns the IExcelOptions object that represents some settings to control workbook behavior.
    • getResetAdjacentRangeBorder

      boolean getResetAdjacentRangeBorder()
      Determines whether to reset adjacent range's border when setting border for a range. The default value of this property is true
    • setResetAdjacentRangeBorder

      void setResetAdjacentRangeBorder(boolean value)
      Determines whether to reset adjacent range's border when setting border for a range. The default value of this property is true
      参数:
      value -
    • getAutoParse

      boolean getAutoParse()
      Gets whether to automatically parse when setting a range value to a string value.
    • setAutoParse

      void setAutoParse(boolean value)
      Sets whether to automatically parse when setting a range value to a string value.
    • getAutoRoundValue

      boolean getAutoRoundValue()
      Gets whether to round the number to 15 significant figures when getting the value.
    • setAutoRoundValue

      void setAutoRoundValue(boolean value)
      Sets whether to round the number to 15 significant figures when getting the value.
    • getBookView

      IWorkbookView getBookView()
      Returns an object that represents the view settings of this workbook.
    • getProtectStructure

      boolean getProtectStructure()
      True if the order of the sheets in the workbook is protected. Read-only Boolean.
    • getProtectWindows

      boolean getProtectWindows()
      True if the windows of the workbook are protected. Read-only Boolean.
    • getSignatures

      ISignatureSet getSignatures()
      Gets a collection of Signature objects that correspond to the digital signature attached to a document.
    • getBuiltInDocumentProperties

      IBuiltInDocumentPropertyCollection getBuiltInDocumentProperties()
      Gets a collection that represents all the built-in document properties of the workbook.
    • getCustomDocumentProperties

      ICustomDocumentPropertyCollection getCustomDocumentProperties()
      Gets a collection that represents all the custom document properties of the workbook.
    • getCustomViews

      ICustomViews getCustomViews()
      Gets the custom views of the workbook.
    • getWriteProtection

      WriteProtection getWriteProtection()
      Returns a WriteProtection object that provides access to the workbook write protection options.
    • getEnableCalculation

      boolean getEnableCalculation()
      Gets whether the calculation engine is valid.
    • setEnableCalculation

      void setEnableCalculation(boolean value)
      Sets whether the calculation engine is valid.
    • getCulture

      Locale getCulture()
      Gets culture info for the workbook. Which influences the feature related culture.
    • setCulture

      void setCulture(Locale value)
      Sets culture info for the workbook. Which influences the feature related culture.
    • getDefaultTableStyle

      String getDefaultTableStyle()
      Gets the table style name from the ITableStyleCollection collectionthat is used as the default TableStyle.
    • setDefaultTableStyle

      void setDefaultTableStyle(String value)
      Sets the table style name from the ITableStyleCollection collectionthat is used as the default TableStyle.
    • getNames

      INames getNames()
      Returns the INames collection that represents all the names in thespecified workbook (including all worksheet-specific names).
    • getAuthor

      String getAuthor()
      Gets the author.
    • setAuthor

      void setAuthor(String value)
      Sets the author.
    • getPivotCaches

      IPivotCaches getPivotCaches()
      Returns the IPivotCaches collection that represents all theIPivotTable caches in the specified workbook.
    • getReferenceStyle

      ReferenceStyle getReferenceStyle()
      Gets the reference style.
    • setReferenceStyle

      void setReferenceStyle(ReferenceStyle value)
      Sets the reference style.
    • getStyles

      IStyleCollection getStyles()
      Returns the IStyleCollection collection that represents all thestyles in the specified workbook.
    • getTableStyles

      ITableStyleCollection getTableStyles()
      Returns the ITableStyleCollection collection object for the currentworkbook that refers to the styles used in the current workbook.
    • getTheme

      ITheme getTheme()
      Returns the theme applied to the current workbook.
    • setTheme

      void setTheme(ITheme value)
      Sets the theme applied to the current workbook.
    • getIconSets

      IIconSets getIconSets()
      Filters data in a workbook based on a cell icon from the IconSets collection.
    • getWorksheets

      IWorksheets getWorksheets()
      Returns the IWorksheets collection that represents all the worksheetsin the specified workbook. This is a read-only Sheets object.
    • getActiveSheet

      IWorksheet getActiveSheet()
      Returns an object that represents the active sheet (the sheet on top) in the active workbook or in the specified window or workbook. Returns null if no sheet is active.
    • getSlicerCaches

      ISlicerCaches getSlicerCaches()
      Gets the ISlicerCaches object associated with the workbook.
    • calculate

      void calculate()
      Calculates formulas of the workbook as needed.
    • dirty

      void dirty()
      Designates all the formulas of the workbook to be recalculated when the next calculation occurs.
    • toJson

      String toJson()
      Generates a json string from a workbook.
      返回:
      the json string.
    • toJson

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

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

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

      boolean isEncryptedFile(String fileName)
      Specifies whether the file is password protected.
      参数:
      fileName - the file name.
    • isEncryptedFile

      boolean isEncryptedFile(InputStream fileStream)
      Specifies whether the file is password protected.
      参数:
      fileStream - the input file stream.
    • open

      void open(String fileName)
      Opens the specified excel file
      参数:
      fileName - The excel file.
    • open

      void open(String fileName, String password)
      Opens the specified excel file
      参数:
      fileName - The excel file.
      password - The password of the file.
    • open

      void open(String fileName, OpenOptionsBase options)
      Opens the file with specified options, the open options can be XlsxOpenOptions, CSVOpenOptions.
      参数:
      fileName - The excel file.
      options - The options of opening the file.
    • open

      void open(String fileName, OpenFileFormat fileFormat)
      Opens the specified format file.
      参数:
      fileName - The specified file.
      fileFormat - The format of the file.
    • open

      void open(InputStream fileStream)
      Opens the specified excel file stream.
      参数:
      fileStream - The file stream.
    • open

      void open(InputStream fileStream, String password)
      Opens the specified excel file stream.
      参数:
      fileStream - The file stream.
      password - The password of the file.
    • open

      void open(InputStream fileStream, OpenOptionsBase options)
      Opens the stream with specified options, the open options can be XlsxOpenOptions, CsvOpenOptions.
      参数:
      fileStream - The file stream.
      options - The format of opening the file stream.
    • open

      void open(InputStream fileStream, OpenFileFormat fileFormat)
      Opens the specified format file stream.
      参数:
      fileStream - The specified file stream.
      fileFormat - The format of the file stream.
    • save

      void save(String fileName)
      Saves the workbook to the disk.
      参数:
      fileName - The file name.
    • save

      void save(String fileName, String password)
      Saves data to the specified excel file.
      参数:
      fileName - The excel file.
      password - The password of the file.
    • save

      void save(String fileName, SaveOptionsBase options)
      Saves workbook to file with specified options. The option can be XlsxSaveOptions, CsvSaveOptions, HtmlSaveOptions
      参数:
      fileName - The specified file.
      options - The options of saving the file.
    • save

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

      void save(OutputStream outputStream)
      Saves the workbook to the stream.
      参数:
      outputStream - The file stream.
    • save

      void save(OutputStream outputStream, String password)
      Saves data to the specified excel file stream.
      参数:
      outputStream - The file stream.
      password - The password of the file.
    • save

      void save(OutputStream fileStream, SaveOptionsBase options)
      Saves workbook to stream with specified options. The option can be XlsxSaveOptions, CsvSaveOptions, HtmlSaveOptions
      参数:
      fileStream - The specified file stream.
      options - The options of saving the file stream.
    • save

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

      void protect()
      Protects a workbook so that it cannot be modified.
    • protect

      void protect(boolean structure)
      Protects a workbook so that it cannot be modified.
      参数:
      structure - True to protect the structure of the workbook (To prevent other users from viewing hidden worksheets, adding, moving, deleting, or hiding worksheets, and renaming worksheets).
    • protect

      void protect(boolean structure, boolean windows)
      Protects a workbook so that it cannot be modified.
      参数:
      structure - True to protect the structure of the workbook (To prevent other users from viewing hidden worksheets, adding, moving, deleting, or hiding worksheets, and renaming worksheets).
      windows - True to prevent users from moving, resizing, or closing the workbook window, or hide/unhide windows. This option is available only in Excel 2007, Excel 2010, Excel for Mac 2011, and Excel 2016 for Mac.
    • protect

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

      void protect(String password, boolean structure)
      Protects a workbook so that it cannot be modified.
      参数:
      password - Password to protect the workbook.
      structure - True to protect the structure of the workbook (To prevent other users from viewing hidden worksheets, adding, moving, deleting, or hiding worksheets, and renaming worksheets).
    • protect

      void protect(String password, boolean structure, boolean windows)
      Protects a workbook so that it cannot be modified.
      参数:
      password - Password to protect the workbook.
      structure - True to protect the structure of the workbook (To prevent other users from viewing hidden worksheets, adding, moving, deleting, or hiding worksheets, and renaming worksheets).
      windows - True to prevent users from moving, resizing, or closing the workbook window, or hide/unhide windows. This option is available only in Excel 2007, Excel 2010, Excel for Mac 2011, and Excel 2016 for Mac.
    • unprotect

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

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

      void addDataSource(String name, Object dataSource)
      Add data source for template
      参数:
      name - : the alias name of the data source
      dataSource - : Can be object of ResultSet, Custom object and variable
    • processTemplate

      void processTemplate()
      Start to process the template
    • generateReport

      IWorkbook generateReport()
      Process the template and return the instance of report workbook.
      返回:
      The new IWorkbook object.
    • generateReport

      IWorkbook generateReport(IWorksheet... worksheets)
      Process the template and return the instance of report workbook.
      参数:
      worksheets - IWorksheet collection that need to be processed.
      返回:
      The new IWorkbook object.
    • getGraphicsInfo

      IGraphicsInfo getGraphicsInfo()
      Provides graphics information. If this property doesn't have value, the workbook will use built-in graphic information.
    • setGraphicsInfo

      void setGraphicsInfo(IGraphicsInfo value)
      Provides graphics information. If this property doesn't have value, the workbook will use built-in graphic information.
    • updateExcelLink

      void updateExcelLink(String name)
      Updates a excel link.
    • updateExcelLink

      void updateExcelLink(String name, IWorkbook sourceWorkbook)
      Updates a excel link.
    • updateExcelLinks

      void updateExcelLinks()
      Updates all the excel links.