[]
Ƭ 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.
Ƭ CsvSettings: Object
Represents CSV export settings.
example
const settings: CsvSettings = {
colSeparator: ',',
rowSeparator: '\n',
outputType: 'plain',
};
| Name | Type | Description |
|---|---|---|
colSeparator? |
string |
Gets or sets the column separator character. |
outputType? |
"zip" | "plain" |
Gets or sets how CSV output is produced. remarks Accepted values: - 'zip': Export each table as a separate file in a ZIP archive. - 'plain': Combine all tables into a single CSV string. |
quotationSymbol? |
string |
Gets or sets the quotation symbol. |
rowSeparator? |
string |
Gets or sets the row separator character. |
tableSeparator? |
string |
Gets or sets the table separator character. |
Ƭ OnProgressCallback: (pageNumber: number) => void
▸ (pageNumber): void
Defines a callback invoked after each page is rendered.
example
const onProgress: OnProgressCallback = (pageNumber) => console.log(pageNumber);
| Name | Type | Description |
|---|---|---|
pageNumber |
number |
The one-based page number that has finished rendering. |
void
Ƭ TabularDataExportResult: Object
Represents the result of a tabular data export.
example
const result: TabularDataExportResult = {
data: 'a,b,c',
download: (name) => console.log(name),
};
| Name | Type | Description |
|---|---|---|
data |
Blob | string |
Gets or sets the exported content. remarks Returns a string for 'plain' output and a Blob for 'zip' output. |
download |
(filename?: string) => void |
Gets or sets the function that triggers a browser download of the export result. example ts const result = {} as TabularDataExportResult; result.download('data.csv'); |
Ƭ TabularDataSettings: Object
Represents tabular data export settings.
example
const settings: TabularDataSettings = {
format: 'csv',
csvSettings: { outputType: 'plain' },
};
| Name | Type | Description |
|---|---|---|
csvSettings? |
CsvSettings |
Gets or sets CSV export settings. |
format? |
"csv" |
Gets or sets the export format. remarks Accepted values: - 'csv' |
▸ exportDocument(source, settings?, onProgress?, checkCancel?): Promise<TabularDataExportResult>
Exports a PageDocument or VDomRenderer to tabular data format.
example
const result = await exportDocument(report, { format: 'csv' });
result.download('report.csv');
| Name | Type | Description |
|---|---|---|
source |
PageDocument | VDomRenderer |
The source document or renderer to export. |
settings? |
TabularDataSettings |
The tabular data export settings. |
onProgress? |
OnProgressCallback |
The callback invoked after each page is rendered. |
checkCancel? |
CheckCancelCallback |
The callback invoked before rendering each page. Return true to cancel. |
Promise<TabularDataExportResult>
A promise that resolves to the export result.