Configuring Export
Summary
- Developers can configure Export at design time in multiple ways
There are many aspects of Export that can be configured by developers, primarily through properties in Export Options, or functions in Export API.
Advanced Exporting
By default Export will send the report to the desired destination in a straightforward way.
For instance exporting to Excel will create a new workbook with default worksheet settings.
However sometimes users want more fine-grained control over the Exported file, e.g. to change the worksheet names, font, or other properties in Excel.
This is possible by using the exportReport function in Export API.
It takes an optional exportConfig property which allows users to modify the params being sent.
exportReport
Multiple ParamsPromise<void>- In this demo we export data to Excel and CSV via the
exportReportfunction in Export API (using Custom Toolbar Buttons), allowing us add bespoke config:- We export
Current Layoutreport to Excel, with custom names for Excel Workbook and Worksheet, and changing font and header row height - We export
All Datareport to CSV, with custom filename and separator
- We export
Configuring Report File Names
By default the name of the file created in an Export is that of the exported Report Name (e.g. 'All Data').
There are 2 options available in Export Options to change this behaviour:
appendFileTimestampwhich appends a Timestamp to the Report name
appendFileTimestamp
Default: falsebooleanreportFilenamewhich allows a completely different Report name to be used
reportFilename
(reportFileNameContext: ReportFileNameContext) => boolean- In this example we provide a custom File Name - but just for the "All Data" Report
Setting Exportable Columns
By default every Column in AdapTable is exportable.
This means that it can be included in System Reports (e.g. All Data) and will be available in UI for selection.
This can be set to false for any Column via the isColumnExportable property in Export Options.
isColumnExportable
Default: trueboolean- In this example we dont export the
LanguageColumn, nor anyDateColumns
Skipping Column Headers
By default AdapTable will include the Column Headers in the Export.
This can be set to false all or some Reports via the skipColumnHeaders property in Export Options.
skipColumnHeaders
Default: trueboolean- In this example we exclude Custom Headers from the "All Data" Report only