[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Workbook

Workbook Class

Represents the workbook class.

Inheritance
Workbook
Implements
Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public sealed class Workbook : IWorkbook
Public NotInheritable Class Workbook
    Implements IWorkbook

Constructors

Name Description
Workbook()

Creates the workbook.

Workbook(WorkbookOptions)

Creates the workbook.

Workbook(string)

Creates the workbook.

Workbook(string, WorkbookOptions)

Creates the workbook.

Properties

Name Description
ActiveSheet

Gets the active sheet.

AllowDynamicArray

This api is obsolete, please use Formula2 to get or set dynamic array formula.

Author

Gets or sets the author.

AutoParse

Determines whether to parse automatically when setting range value to string value.

AutoRoundValue

Determines whether to round the number to 15 significant figures when getting the value.

BookView

Returns an object that represents the view settings of this workbook(read-only).

BuiltInDocumentProperties

Gets a collection that represents all the built-in document properties of the workbook.

Culture

[Init-only] Gets or sets culture for the workbook. The culture must contain both country/region and language.

CustomDocumentProperties

Gets a collection that represents all the custom document properties of the workbook.

CustomViews

Gets the custom views of the workbook.

DefaultTableStyle

Specifies the table style that is used as the default TableStyle.

DeferUpdateDirtyState

Gets or sets whether update the dirty state of the formula cells immediately when changing the value of a cell.

EnableCalculation

Specifies whether the calculation engine is working.

FontsFolderPath

Gets or sets the location of font files that will be used when exporting pdf.

FullName

Returns the name of the workbook, including its path on disk.

GraphicsInfo

Provides graphics information. If this property doesn't have value, the workbook will use built-in graphic information.

IconSets

Filters data in a workbook based on a cell icon from the IconSets collection. This property is read-only.

LoggerFactory

Gets or sets the logger factory shared by all workbooks.

Name

Get or set a string value that represents the name of the workbook.

Names

Returns the INames collection that represents the workbook-specified names. The Names object is read-only.

Options

Returns the IExcelOptions object that represents some settings to control workbook behavior.

Path

Gets or sets a string that represents the path to the workbook file that this workbook object represents.

PivotCaches

Gets a PivotCaches collection that represents all the PivotTable caches in the specified workbook.

ProtectStructure

True if the order of the sheets in the workbook is protected. Read-only Boolean.

ProtectWindows

True if the windows of the workbook are protected. Read-only Boolean.

ReferenceStyle

Gets or sets the reference style.

ResetAdjacentRangeBorder

Determines whether to reset adjacent range's border when setting border for a range. The default value of this property is true.

SelectedSheets

Returns a IWorksheets collection that represents all the selected sheets in the specified workbook.

ShowPivotTableFieldList

Gets or sets a value indicating whether the PivotTable field list can be shown. Default is true.

Signatures

Gets a collection of Signature objects that correspond to the digital signature attached to a document.

SlicerCaches

Gets the ISlicerCaches object associated with the workbook.

Styles

Provides access to the collection of cell styles in the current workbook.

TableStyles

Gets the table styles used in the current workbook.

TagJsonSerializer

Gets or sets the json serializer/deserializer for custom type.

Theme

Returns an instance of ITheme which provides access to the theme associated with a workbook.

ValueJsonSerializer

Gets or sets the json serializer/deserializer for custom cell values

WebRequestHandler

Gets or sets the singleton instance of the IWebRequestHandler implementation that will be used to handle web requests. This property provides a centralized way to access and set the web request handler for the application.

Worksheets

Gets a collection of worksheets contained in the workbook.

WriteProtection

Returns a WriteProtection object that provides access to the workbook write protection options.

Methods

Name Description
AddCustomFunction(CustomFunction, bool)

Add custom function into the function set.

AddDataSource(string, object)

Add data source for template.

Calculate()

Calculates formulas in the workbook as needed.

ConvertBarcodeToPicture(ImageType)

Convert the calculated barcodes to pictures and place them in their respective positions. The original barcode formulas will be cleared.
Not support EMF and WMF image types.

Dirty()

Designates all the formulas of the workbook to be recalculated when the next calculation occurs.

FromJson(Stream, DeserializationOptions)

Generates a workbook from a json stream.

FromJson(string, DeserializationOptions)

Generates a workbook from a json string.

FromSjsJson(Stream)

Generates a workbook from a JSON stream containing the contents of .sjs file format.

FromSjsJson(Stream, SjsOpenOptions)

Generates a workbook from a JSON stream containing the contents of .sjs file format.

FromSjsJson(string)

Generates a workbook from a JSON string containing the contents of .sjs file format.

FromSjsJson(string, SjsOpenOptions)

Generates a workbook from a JSON string containing the contents of .sjs file format.

GenerateReport()

Process the template and return the instance of report workbook.

GenerateReport(params IWorksheet[])

Process the template and return the instance of report workbook.

GetExcelLinkSources()

Returns the names of the linked excel documents.

GetNames(Stream)

Gets all sheet names and tables names that will be used as the parameter source of ImportData.
If the name is a table name, the worksheet name is qualified before the table name, such as "Sheet1!Table1".

GetNames(string)

Gets all sheet names and tables names that will be used as the parameter source of ImportData.
If the name is a table name, the worksheet name is qualified before the table name, such as "Sheet1!Table1".

GetUsedFonts()

Gets all fonts information that are used on workbook.

ImportData(Stream, string)

Import all the data of the specified source of the file.

ImportData(Stream, string, int, int, int, int)

Import the data of a specified range from a fileStream.

ImportData(string, string)

Import all the data of the specified source of the file.

ImportData(string, string, int, int, int, int)

Import the data of a specified range from a file.

IsEncryptedFile(Stream)

Specifies whether the file is password protected.

IsEncryptedFile(string)

Specifies whether the file is password protected.

Open(Stream)

Opens the file stream.

Open(Stream, OpenFileFormat)

Opens the stream with specified file format.

Open(Stream, OpenOptionsBase)

Opens the stream with specified options.

Open(Stream, string, OpenOptions)

Opens the specified excel file stream.

Open(string)

Opens the file with default options. The file type is inferred from file extension.

Open(string, DeserializationOptions)

Opens the json file.

Open(string, OpenFileFormat)

Opens the file with specified file format.

Open(string, OpenOptionsBase)

Opens the file with specified options.

Open(string, string, OpenOptions)

Opens the specified excel file

PrintOut(PrintOutOptions)

Prints the workbook.

ProcessTemplate()

Start to process the template with global options.

ProcessTemplate(CancellationToken)

Start to process the template with global options and cancellation support.

Protect(bool, bool)

Protects a workbook so that it cannot be modified.

Protect(string, bool, bool)

Protects a workbook so that it cannot be modified.

Save(Stream)

Saves the workbook to the stream.

Save(Stream, SaveFileFormat)

Saves workbook to stream with specified file format.

Save(Stream, SaveOptionsBase)

Saves workbook to stream with specified options.

Save(Stream, string, SaveOptions)

Saves workbook to the specified excel file stream.

Save(string)

Saves the workbook to the disk.

Save(string, SaveFileFormat)

Saves workbook to file with specified file format.

Save(string, SaveOptionsBase)

Saves workbook to file with specified options.

Save(string, string, SaveOptions)

Saves data to the specified excel file.

SetLicenseKey(string)

Set the license key of Documents for Excel.

ToJson(SerializationOptions)

Generates a json string from a workbook.

ToJson(Stream, SerializationOptions)

Generates a json stream from a workbook.

ToSjsJson()

Generates a JSON string from a workbook. It integrates all JSON files from the SpreadJS .sjs file into a single string.

ToSjsJson(SjsSaveOptions)

Generates a JSON string from a workbook. It integrates all JSON files from the SpreadJS .sjs file into a single string.

ToSjsJson(Stream)

Integrates all JSON files from the SpreadJS .sjs file into a single string, then put the string into the stream.

ToSjsJson(Stream, SjsSaveOptions)

Integrates all JSON files from the SpreadJS .sjs file into a single string, then put the string into the stream.

Unprotect(string)

Removes protection from the workbook.

Updates a excel link.

Updates a excel link.

Updates all the excel links.

WaitForCalculationToFinish()

Waits for all calculation to complete, includes 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.

Events

Name Description
AfterSave

Occurs after the workbook is saved.

BeforeSave

Occurs before the workbook is saved.

NewSheet

Occurs when a new sheet is created in the workbook.

Opened

Occurs when the workbook is opened.

SheetActivate

Occurs when a sheet is active.

SheetBeforeDelete

Occurs before a sheet is deleted.

SheetChange

Occurs when something changes in the cells of a sheet.

SheetDeactivate

Occurs when a sheet is deactivated.

SheetSelectionChange

Occurs when the selection changes on a sheet.