Workbook
Represents a spreadsheet workbook.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Workbook(jsf: Workbook): Workbook;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
jsf | Workbook |
Returns
Section titled “Returns”Workbook
Properties
Section titled “Properties”| Property | Type |
|---|---|
_sheets | WorkSheet[] |
_tables | Map<string, Table> |
calcMode | "auto" | "autoNoTable" | "manual" |
epoch | 1900 | 1904 |
filename | string |
formulas | string[] |
images? | Record<string, string> |
instanceId | number |
iterate | boolean |
iterateCount | number |
iterateDelta | number |
name | string |
names | DefinedName[] |
styles | StyleManager |
theme? | ThemeManager |
views? | WorkbookView[] |
Methods
Section titled “Methods”getSheet()
Section titled “getSheet()”getSheet(sheetName?: string | null): WorkSheet | null;Returns the specified worksheet instance by name or the first sheet if no name is provided.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
sheetName? | string | null | The name of the worksheet. |
Returns
Section titled “Returns”WorkSheet | null
getSheetByIndex()
Section titled “getSheetByIndex()”getSheetByIndex(index?: number | null): WorkSheet | null;Returns the specified worksheet instance by index or the first sheet if no index is provided.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
index? | number | null | The index of the table. |
Returns
Section titled “Returns”WorkSheet | null
getSheets()
Section titled “getSheets()”getSheets(): WorkSheet[];Returns a list of worksheet instances.
Returns
Section titled “Returns”getSheetSize()
Section titled “getSheetSize()”getSheetSize(sheetName: string | null): [number, number];Returns the size of the specified worksheet instance as a tuple of [columns, rows].
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
sheetName | string | null | The name of the worksheet. |
Returns
Section titled “Returns”[number, number]
getTable()
Section titled “getTable()”getTable(name: string): Table | null;Returns a specified table instance by name.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
name | string | The name of the table. |
Returns
Section titled “Returns”Table | null
getTables()
Section titled “getTables()”getTables(): Table[];Returns a list of table instances.
Returns
Section titled “Returns”Table[]
setColumnWidth()
Section titled “setColumnWidth()”setColumnWidth( sheetName: string, column: number, width: number): void | undefined;Sets the width of a specified column in a worksheet by its (zero-based) index.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
sheetName | string | The name of the worksheet. |
column | number | The 0-based index of the target column. |
width | number | The width to set, in pixels. |
Returns
Section titled “Returns”void | undefined
setRowHeight()
Section titled “setRowHeight()”setRowHeight( sheetName: string, rowNum: number, height: number): boolean | undefined;Sets the height of a specified row in a worksheet by its (zero-based) index.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
sheetName | string | The name of the worksheet. |
rowNum | number | The 0-based index of the target row. |
height | number | The height to set, in pixels. |
Returns
Section titled “Returns”boolean | undefined