# TabularDataExport

## Content

# Namespace: TabularDataExport

## Table of contents

### Type aliases

- [CheckCancelCallback](TabularDataExport#checkcancelcallback)
- [CsvSettings](TabularDataExport#csvsettings)
- [OnProgressCallback](TabularDataExport#onprogresscallback)
- [TabularDataExportResult](TabularDataExport#tabulardataexportresult)
- [TabularDataSettings](TabularDataExport#tabulardatasettings)

### Functions

- [exportDocument](TabularDataExport#exportdocument)

## Type aliases

### <a id="checkcancelcallback" name="checkcancelcallback"></a> CheckCancelCallback

Ƭ **CheckCancelCallback**: () => `boolean`

#### Type declaration

▸ (): `boolean`

The type of callback that gets called before sheet rendering, the render process will be canceled if the function returns _true_.

##### Returns

`boolean`

___

### <a id="csvsettings" name="csvsettings"></a> CsvSettings

Ƭ **CsvSettings**: `Object`

Csv export settings.

#### Type declaration

| Name | Type | Description |
| :------ | :------ | :------ |
| `colSeparator?` | `string` | Columns separator character |
| `outputType?` | ``"zip"`` \| ``"plain"`` | Export each table as separate file ('zip') or combine it to single CSV |
| `quotationSymbol?` | `string` | Quotation symbol |
| `rowSeparator?` | `string` | Rows separator character |
| `tableSeparator?` | `string` | Tables separator character |

___

### <a id="onprogresscallback" name="onprogresscallback"></a> OnProgressCallback

Ƭ **OnProgressCallback**: (`pageNumber`: `number`) => `void`

#### Type declaration

▸ (`pageNumber`): `void`

The type of callback that gets called after each sheet is rendered.

##### Parameters

| Name | Type |
| :------ | :------ |
| `pageNumber` | `number` |

##### Returns

`void`

___

### <a id="tabulardataexportresult" name="tabulardataexportresult"></a> TabularDataExportResult

Ƭ **TabularDataExportResult**: `Object`

Export result

#### Type declaration

| Name | Type | Description |
| :------ | :------ | :------ |
| `data` | `Blob` \| `string` | Result content. |
| `download` | (`filename?`: `string`) => `void` | Triggers browser download of file with export result. |

___

### <a id="tabulardatasettings" name="tabulardatasettings"></a> TabularDataSettings

Ƭ **TabularDataSettings**: `Object`

Tabular Data export settings.

#### Type declaration

| Name | Type | Description |
| :------ | :------ | :------ |
| `csvSettings?` | [`CsvSettings`](TabularDataExport#csvsettings) | CSV export settings |
| `format?` | ``"csv"`` | Export format |

## Functions

### <a id="exportdocument" name="exportdocument"></a> exportDocument

▸ **exportDocument**(`source`, `settings?`, `onProgress?`, `checkCancel?`): `Promise`<[`TabularDataExportResult`](TabularDataExport#tabulardataexportresult)\>

Exports a provided PageDocument to the Tabular Data format and returns it as Blob or string.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `source` | [`PageDocument`](../classes/Core.PageDocument) \| `VDomRenderer` | The document to export. |
| `settings?` | [`TabularDataSettings`](TabularDataExport#tabulardatasettings) | Export settings. |
| `onProgress?` | [`OnProgressCallback`](TabularDataExport#onprogresscallback) | The callback that gets called after each sheet is rendered. |
| `checkCancel?` | [`CheckCancelCallback`](TabularDataExport#checkcancelcallback) | The callback that gets called before sheet rendering, the render process will be canceled if the function returns _true_. |

#### Returns

`Promise`<[`TabularDataExportResult`](TabularDataExport#tabulardataexportresult)\>
