[]
Ƭ CheckCancelCallback: () => boolean
▸ (): boolean
Defines a callback that determines whether export should be canceled.
example
const shouldCancel: CheckCancelCallback = () => false;
boolean
true to cancel the export; otherwise, false.
Ƭ OnProgressCallback: (pageNumber: number) => void
▸ (pageNumber): void
Defines a callback invoked after each sheet is rendered.
example
const onProgress: OnProgressCallback = (pageNumber) => console.log(pageNumber);
| Name | Type | Description |
|---|---|---|
pageNumber |
number |
The one-based sheet number that has finished rendering. |
void
Ƭ XlsxAdvSettings: Object
Represents advanced XLSX export settings.
example
const settings: XlsxAdvSettings = {
info: { creator: 'Contoso' },
password: 'secret',
};
| Name | Type | Description |
|---|---|---|
info? |
XlsxSettingsInfo |
Gets or sets the document metadata. |
password? |
string |
Gets or sets the password used to encrypt the document. |
Ƭ XlsxExportResult: Object
Represents the result of an XLSX export.
example
const result: XlsxExportResult = {
data: new Blob(),
download: (name) => console.log(name),
};
| 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: Object
Represents XLSX document metadata.
example
const info: XlsxSettingsInfo = { creator: 'Contoso' };
| Name | Type | Description |
|---|---|---|
creator? |
string |
Gets or sets the document creator. |
▸ 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');
| 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. |
Promise<XlsxExportResult>
A promise that resolves to the export result.