Skip to content

Workbook

Represents a spreadsheet workbook.

new Workbook(jsf: Workbook): Workbook;
ParameterType
jsfWorkbook

Workbook

PropertyType
_sheetsWorkSheet[]
_tablesMap<string, Table>
calcMode"auto" | "autoNoTable" | "manual"
epoch1900 | 1904
filenamestring
formulasstring[]
images?Record<string, string>
instanceIdnumber
iterateboolean
iterateCountnumber
iterateDeltanumber
namestring
namesDefinedName[]
stylesStyleManager
theme?ThemeManager
views?WorkbookView[]
getSheet(sheetName?: string | null): WorkSheet | null;

Returns the specified worksheet instance by name or the first sheet if no name is provided.

ParameterTypeDescription
sheetName?string | nullThe name of the worksheet.

WorkSheet | null


getSheetByIndex(index?: number | null): WorkSheet | null;

Returns the specified worksheet instance by index or the first sheet if no index is provided.

ParameterTypeDescription
index?number | nullThe index of the table.

WorkSheet | null


getSheets(): WorkSheet[];

Returns a list of worksheet instances.

WorkSheet[]


getSheetSize(sheetName: string | null): [number, number];

Returns the size of the specified worksheet instance as a tuple of [columns, rows].

ParameterTypeDescription
sheetNamestring | nullThe name of the worksheet.

[number, number]


getTable(name: string): Table | null;

Returns a specified table instance by name.

ParameterTypeDescription
namestringThe name of the table.

Table | null


getTables(): Table[];

Returns a list of table instances.

Table[]


setColumnWidth(
sheetName: string,
column: number,
width: number): void | undefined;

Sets the width of a specified column in a worksheet by its (zero-based) index.

ParameterTypeDescription
sheetNamestringThe name of the worksheet.
columnnumberThe 0-based index of the target column.
widthnumberThe width to set, in pixels.

void | undefined


setRowHeight(
sheetName: string,
rowNum: number,
height: number): boolean | undefined;

Sets the height of a specified row in a worksheet by its (zero-based) index.

ParameterTypeDescription
sheetNamestringThe name of the worksheet.
rowNumnumberThe 0-based index of the target row.
heightnumberThe height to set, in pixels.

boolean | undefined