[]
        
(Showing Draft Content)

XlsxAdvExport

Namespace: XlsxAdvExport

Table of contents

Type aliases

Functions

Type aliases

CheckCancelCallback

Ƭ CheckCancelCallback: () => boolean

Type declaration

▸ (): boolean

Defines a callback that determines whether export should be canceled.

example

const shouldCancel: CheckCancelCallback = () => false;
Returns

boolean

true to cancel the export; otherwise, false.


OnProgressCallback

Ƭ OnProgressCallback: (pageNumber: number) => void

Type declaration

▸ (pageNumber): void

Defines a callback invoked after each sheet is rendered.

example

const onProgress: OnProgressCallback = (pageNumber) => console.log(pageNumber);
Parameters
Name Type Description
pageNumber number The one-based sheet number that has finished rendering.
Returns

void


XlsxAdvSettings

Ƭ XlsxAdvSettings: Object

Represents advanced XLSX export settings.

example

const settings: XlsxAdvSettings = {
	info: { creator: 'Contoso' },
	password: 'secret',
};

Type declaration

Name Type Description
info? XlsxSettingsInfo Gets or sets the document metadata.
password? string Gets or sets the password used to encrypt the document.

XlsxExportResult

Ƭ XlsxExportResult: Object

Represents the result of an XLSX export.

example

const result: XlsxExportResult = {
	data: new Blob(),
	download: (name) => console.log(name),
};

Type declaration

Name Type Description
data Blob Gets or sets the exported content.
download (filename?: string) => void Gets or sets the function that triggers a browser download of the export result. example ts const result = {} as XlsxExportResult; result.download('report.xlsx');

XlsxSettingsInfo

Ƭ XlsxSettingsInfo: Object

Represents XLSX document metadata.

example

const info: XlsxSettingsInfo = { creator: 'Contoso' };

Type declaration

Name Type Description
creator? string Gets or sets the document creator.

Functions

exportDocument

▸ exportDocument(source, settings?, onProgress?, checkCancel?): Promise<XlsxExportResult>

Exports a PageDocument or VDomRenderer to XLSX using the cell-based pipeline.

example

const result = await exportDocument(report, { password: 'secret' });
result.download('report.xlsx');

Parameters

Name Type Description
source PageDocument | VDomRenderer | (options: RenderOptions & { forceCellbased?: boolean }) => Promise<VDomRenderer> The source document, renderer, or renderer factory to export.
settings? XlsxAdvSettings The advanced XLSX export settings.
onProgress? OnProgressCallback The callback invoked after each sheet is rendered.
checkCancel? CheckCancelCallback The callback invoked before rendering each sheet. Return true to cancel.

Returns

Promise<XlsxExportResult>

A promise that resolves to the export result.