[]
        
(Showing Draft Content)

IWorkbook

Interface IWorkbook

All Known Implementing Classes:
Workbook

public interface IWorkbook
Represents an IWorkbook object.
  • Method Details

    • getAfterSaveEvent

      Event<EventHandler<EventArgs>> getAfterSaveEvent()
      Occurs after the workbook is saved.
    • getBeforeSaveEvent

      Event<EventHandler<EventArgs>> getBeforeSaveEvent()
      Occurs before the workbook is saved.
    • getNewSheetEvent

      Event<EventHandler<SheetEventArgs>> getNewSheetEvent()
      Occurs when a new sheet is created in the workbook.
    • getOpenedEvent

      Event<EventHandler<EventArgs>> getOpenedEvent()
      Occurs when the workbook is opened.
    • getSheetActivateEvent

      Event<EventHandler<SheetEventArgs>> getSheetActivateEvent()
      Occurs when a sheet is activate.
    • getSheetBeforeDeleteEvent

      Event<EventHandler<SheetEventArgs>> getSheetBeforeDeleteEvent()
      Occurs before a sheet is deleted.
    • getSheetChangeEvent

      Event<EventHandler<RangeEventArgs>> getSheetChangeEvent()
      Occurs when something changes in the cells of a sheet.
    • getSheetDeactivateEvent

      Event<EventHandler<SheetEventArgs>> getSheetDeactivateEvent()
      Occurs when a sheet is deactivated.
    • getSheetSelectionChange

      Event<EventHandler<RangeEventArgs>> getSheetSelectionChange()
      Occurs when the selection changes on a sheet.
    • getAllowDynamicArray

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

      @Deprecated void setAllowDynamicArray(boolean value)
      Deprecated.
      method is obsoleted, please use IRange.setFormula2(String) to set dynamic array formula.
      Sets whether allow 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.
      Parameters:
      value - True to reset the border of adjacent ranges, false otherwise.
    • 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.

      The culture must contain both country/region and language. For example:

      API Note:
      The culture is init-only. It must be set in the initialization code of the workbook instance.
    • 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 the workbook-specified 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.
    • fromJson

      List<JsonError> fromJson(String json)
      Generates a workbook from a json string.
      Parameters:
      json - the json.
      Returns:
      the errors in the json.
    • fromJson

      List<JsonError> fromJson(String json, DeserializationOptions deserializationOptions)
      Generates a workbook from a json string.
      Parameters:
      json - the json.
      deserializationOptions - the DeserializationOptions object.
      Returns:
      the errors in the json.
    • fromJson

      List<JsonError> fromJson(InputStream stream)
      Generates a workbook from a json stream.
      Parameters:
      stream - the stream
      Returns:
      the errors in the json.
    • fromJson

      List<JsonError> fromJson(InputStream stream, DeserializationOptions deserializationOptions)
      Generates a workbook from a json stream.
      Parameters:
      stream - the stream
      deserializationOptions - the DeserializationOptions object.
      Returns:
      the errors in the json.
    • toJson

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

      String toJson(SerializationOptions serializationOptions)
      Generates a json string from the workbook.
      Parameters:
      serializationOptions - the SerializationOptions object.
      Returns:
      The json string
    • toJson

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

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

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

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

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

      List<JsonError> open(String fileName, DeserializationOptions deserializationOptions)
      Opens the json file.
      Parameters:
      fileName - The specified json file.
      deserializationOptions - The json deserialization options.
      Returns:
      Json errors
    • open

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

      void open(String fileName, OpenOptionsBase options)
      Opens the file with specified options.
      Parameters:
      fileName - The excel file.
      options - The options of opening the file. Possible types:
    • open

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

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

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

      void open(InputStream fileStream, OpenOptionsBase options)
      Opens the stream with specified options.
      Parameters:
      fileStream - The file stream.
      options - The format of opening the file stream. Possible types:
    • open

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

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

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

      void save(String fileName, SaveOptionsBase options)
      Saves workbook to file with specified options.
      Parameters:
      fileName - The specified file.
      options - The options of saving the file. Possible types:
    • save

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

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

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

      void save(OutputStream fileStream, SaveOptionsBase options)
      Saves workbook to stream with specified options.
      Parameters:
      fileStream - The specified file stream.
      options - The options of saving the file stream. Possible types:
    • save

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

      List<FontInfo> getUsedFonts()
      Gets all fonts information that used on workbook.
    • 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.
      Parameters:
      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.
      Parameters:
      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.
      Parameters:
      password - Password to protect the workbook.
    • protect

      void protect(String password, boolean structure)
      Protects a workbook so that it cannot be modified.
      Parameters:
      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.
      Parameters:
      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.
      Parameters:
      password - Password to protect the workbook.
    • addDataSource

      void addDataSource(String name, Object dataSource)
      Add data source for template.
      Parameters:
      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.
    • processTemplate

      void processTemplate(CancellationToken cancellationToken)
      Start to process the template with global options and cancellation support.
      Parameters:
      cancellationToken - The token to monitor for cancellation requests.
      Throws:
      CancellationException - Throws when the CancellationToken was canceled.
      API Note:
      The caller must decide whether to accept the partially expanded template or revert to the previous state. If the caller needs to revert to the previous state, it must serialize the workbook before calling this method, then deserialize the workbook after canceling the operation.
    • generateReport

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

      IWorkbook generateReport(IWorksheet... worksheets)
      Process the template and return the instance of report workbook.
      Parameters:
      worksheets - IWorksheet collection that need to be processed.
      Returns:
      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.
    • getExcelLinkSources

      List<String> getExcelLinkSources()
      Returns the names of the linked excel documents.
    • void updateExcelLink(String name)
      Updates a excel link.
    • void updateExcelLink(String name, IWorkbook sourceWorkbook)
      Updates a excel link.
    • void updateExcelLinks()
      Updates all the excel links.
    • toSjsJson

      String toSjsJson()
      Generates a JSON string from a workbook. It integrates all JSON files from the SpreadJS .sjs file into a single string.
      Returns:
      Json data.
    • toSjsJson

      String toSjsJson(SjsSaveOptions options)
      Generates a JSON string from a workbook. It integrates all JSON files from the SpreadJS .sjs file into a single string.
      Parameters:
      options - Option for opening SpreadJS .sjs file.
      Returns:
      Json data.
    • toSjsJson

      void toSjsJson(OutputStream stream, SjsSaveOptions options)
      Integrates all JSON files from the SpreadJS .sjs file into a single string, then put the string into the stream.
      Parameters:
      stream - The specified file stream.
      options - Option for opening SpreadJS .sjs file.
    • toSjsJson

      void toSjsJson(OutputStream stream)
      Integrates all JSON files from the SpreadJS .sjs file into a single string, then put the string into the stream.
      Parameters:
      stream - The specified file stream.
    • convertBarcodeToPicture

      void convertBarcodeToPicture()
      Convert the calculated barcodes to pictures and place them in their respective positions.
      The original barcode formulas will be cleared.
      The ImageType of converted image is ImageType.SVG.
    • convertBarcodeToPicture

      void convertBarcodeToPicture(ImageType imageType)
      Convert the calculated barcodes to pictures of pictures and place them in their respective positions.
      The original barcode formulas will be cleared.
      Not support ImageType.EMF and ImageType.WMF image types.
      Parameters:
      imageType - Specify the ImageType of converted image.
      Throws:
      UnsupportedOperationException - If convert to ImageType.EMF or ImageType.WMF image type.
    • fromSjsJson

      void fromSjsJson(String json)
      Generates a workbook from a JSON string containing the contents of .sjs file format.
      Parameters:
      json - The JSON string.
    • fromSjsJson

      void fromSjsJson(String json, SjsOpenOptions openOptions)
      Generates a workbook from a JSON string containing the contents of .sjs file format.
      Parameters:
      json - The JSON string.
      openOptions - The open options for opening SpreadJS .sjs file.
    • fromSjsJson

      void fromSjsJson(InputStream stream, SjsOpenOptions openOptions)
      Generates a workbook from a JSON stream containing the contents of .sjs file format.
      Parameters:
      stream - The JSON stream.
      openOptions - The open options for opening SpreadJS .sjs file.
    • fromSjsJson

      void fromSjsJson(InputStream stream)
      Generates a workbook from a JSON stream containing the contents of .sjs file format.
      Parameters:
      stream - The JSON stream.
    • waitForCalculationToFinish

      void waitForCalculationToFinish()
      Waits for all calculation to complete, including asynchronous calculations. This method blocks the current thread until all calculations have finished. Users can call this method to ensure that all necessary computations have been performed before proceeding with any other operations that depend on the calculation results.
    • getShowPivotTableFieldList

      boolean getShowPivotTableFieldList()
      Gets a value indicating whether the PivotTable field list can be shown. Default is true.
    • setShowPivotTableFieldList

      void setShowPivotTableFieldList(boolean value)
      Sets a value indicating whether the PivotTable field list can be shown.