ExportApi
Reports and scheduled exports: which report and format are selected, where a report can be sent, and running or scheduling an export.
export interfaceMethods
| Method | Returns | Description |
|---|---|---|
| addScheduledReport(reportSchedule) | void | Adds a schedule that runs a report on a cron expression or at one time. |
| applyScheduledReport(reportSchedule) | void | Runs a scheduled export now and records that the job ran. |
| canExportToCsv() | boolean | Whether this instance can export to CSV. |
| canExportToExcel() | boolean | Whether this instance can export to Excel. |
| clearFormat() | void | Sets the Report Format to null |
| clearReport() | void | Sets the Report to null |
| deleteScheduledReport(reportSchedule) | void | Removes a scheduled report. |
| editScheduledReport(reportSchedule) | void | Replaces a scheduled report already in state. |
| ensureScheduledReportUuids() | void | Ensures every scheduled report has a unique Uuid (legacy state may omit them). |
| exportReport(reportName, format, destination, exportConfig) | Promise<void> | Exports the Report with the given Name and Format to the given Destination |
| getActiveScheduledReports() | ReportSchedule[] | Scheduled reports that are not suspended. |
| getAllExportDestinations() | ExportDestinationType[] | Retrieves the available export destinations |
| getAllFormats() | ReportFormatType[] | Every report format that can be selected, system and custom. |
| getAllReports() | Report[] | Retrieves all available Reports - System and User-created Reports |
| getAvailableCustomDestinations() | CustomDestination[] | Custom destinations supplied in Export Options. |
| getAvailableSystemDestinations() | SystemExportDestination[] | System destinations that Export Options allow. |
| getAvailableSystemFormats() | SystemReportFormat[] | System report formats that Export Options allow. |
| getAvailableSystemReports() | SystemReportName[] | System report names that Export Options allow. |
| getCurrentReport() | Report | undefined | Retrieves currently selected Report in Adaptable State |
| getCurrentReportFormat() | ReportFormatType | undefined | Format currently selected for export. |
| getCurrentReportName() | ReportNameType | undefined | Name of the report currently selected for export. |
| getCustomReports() | Report[] | Reports created by the user. System reports are not included. |
| getDestinationByName(destinationName) | SystemExportDestination|CustomDestination | undefined | Retrieves Destination with the given name |
| getExportDestinationForm(destinationName) | AdaptableForm<ExportFormContext> | undefined | The form a custom destination shows before export. |
| getExportState() | ExportState | The Export section of Adaptable State. |
| getReportById(id) | Report | Retrieves Report by Id |
| getReportByName(reportName) | Report | undefined | Retrieves Report with the given name |
| getReportData(reportName, format, config) | Promise<ExportResultData> | Gets the data for the Report with the given Name in the given Format |
| getScheduledReportById(reportScheduleId) | ReportSchedule | undefined | A scheduled report looked up by its id. |
| getScheduledReports() | ReportSchedule[] | Every scheduled report, including suspended ones. |
| getSupportedExportDestinations(reportFormat) | ExportDestinationType[] | Retrieves the Export Destinations that are supported for the given Report Format |
| isColumnExportable(adaptablColumn) | boolean | Whether a column is included in an export. |
| isExportDestinationSystem(destinationName) | boolean | Whether the destination is one AdapTable provides (Download or Clipboard) rather than a custom destination. |
| openExportSettingsPanel() | void | Open Settings Panel with Export section selected |
| selectFormat(reportFormat) | void | Selects the report format used by the next export. |
| selectReport(reportName) | void | Selects the Report in the Adaptable State |
| suspendScheduledReport(reportSchedule) | void | Stops a schedule from running until it is unsuspended. |
| unSuspendScheduledReport(reportSchedule) | void | Makes a suspended schedule run again. |
| updateReport(report) | Report | Updates an existing report |
| updateReports(reports) | Report[] | Replaces the given custom reports in Export State. |
Method Details
addScheduledReport
Adds a schedule that runs a report on a cron expression or at one time.
addScheduledReport(reportSchedule: ReportSchedule): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| reportSchedule | ReportSchedule | Schedule to add |
Returns
void
applyScheduledReport
Runs a scheduled export now and records that the job ran.
applyScheduledReport(reportSchedule: ReportSchedule): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| reportSchedule | ReportSchedule | Schedule to run |
Returns
void
canExportToCsv
Whether this instance can export to CSV.
canExportToCsv(): boolean;Returns
false when CSV export is turned off. The CSV destination is then hidden
boolean
canExportToExcel
Whether this instance can export to Excel.
canExportToExcel(): boolean;Returns
false when Excel export is turned off. The Excel destination is then hidden
boolean
clearFormat
Sets the Report Format to null
clearFormat(): void;Returns
void
clearReport
Sets the Report to null
clearReport(): void;Returns
void
deleteScheduledReport
Removes a scheduled report.
deleteScheduledReport(reportSchedule: ReportSchedule): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| reportSchedule | ReportSchedule | Schedule to delete |
Returns
void
editScheduledReport
Replaces a scheduled report already in state.
editScheduledReport(reportSchedule: ReportSchedule): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| reportSchedule | ReportSchedule | Schedule to save, matched by Uuid |
Returns
void
ensureScheduledReportUuids
Ensures every scheduled report has a unique Uuid (legacy state may omit them).
ensureScheduledReportUuids(): void;Returns
void
exportReport
Exports the Report with the given Name and Format to the given Destination
exportReport(reportName: ReportNameType, format: ReportFormatType, destination?: ExportDestinationType, exportConfig?: ExportConfig): Promise<void>;Parameters
| Parameter | Type | Description |
|---|---|---|
| reportName | ReportNameType | name of the report |
| format | ReportFormatType | format of the report |
| destination | ExportDestinationType | destination to export to |
| exportConfig | ExportConfig | optional export configuration |
Returns
Promise<void>
getActiveScheduledReports
Scheduled reports that are not suspended.
getActiveScheduledReports(): ReportSchedule[];Returns
The active schedules
getAllExportDestinations
Retrieves the available export destinations
getAllExportDestinations(): ExportDestinationType[];Returns
export destinations
getAllFormats
Every report format that can be selected, system and custom.
getAllFormats(): ReportFormatType[];Returns
The format names
getAllReports
Retrieves all available Reports - System and User-created Reports
getAllReports(): Report[];Returns
reports
Report[]
getAvailableCustomDestinations
Custom destinations supplied in Export Options.
getAvailableCustomDestinations(): CustomDestination[];Returns
The custom destinations. Empty when none are configured
getAvailableSystemDestinations
System destinations that Export Options allow.
getAvailableSystemDestinations(): SystemExportDestination[];Returns
'Download' and 'Clipboard', limited to those enabled in Export Options
getAvailableSystemFormats
System report formats that Export Options allow.
getAvailableSystemFormats(): SystemReportFormat[];Returns
'Excel', 'VisualExcel', 'CSV' and 'JSON', limited to those enabled in Export Options
getAvailableSystemReports
System report names that Export Options allow.
getAvailableSystemReports(): SystemReportName[];Returns
'All Data', 'Current Layout' and 'Selected Data', limited to those enabled in Export Options
getCurrentReport
Retrieves currently selected Report in Adaptable State
getCurrentReport(): Report | undefined;Returns
report that is currently selected
Report | undefined
getCurrentReportFormat
Format currently selected for export.
getCurrentReportFormat(): ReportFormatType | undefined;Returns
'Excel', 'VisualExcel', 'CSV', 'JSON', or a custom format name. undefined when no format is selected
ReportFormatType | undefined
getCurrentReportName
Name of the report currently selected for export.
getCurrentReportName(): ReportNameType | undefined;Returns
The report name, or undefined when no report is selected
ReportNameType | undefined
getCustomReports
Reports created by the user. System reports are not included.
getCustomReports(): Report[];Returns
The custom reports
Report[]
getDestinationByName
Retrieves Destination with the given name
getDestinationByName(destinationName: ExportDestinationType): SystemExportDestination | CustomDestination | undefined;Parameters
| Parameter | Type | Description |
|---|---|---|
| destinationName | ExportDestinationType | destination to retrieve |
Returns
export destination
SystemExportDestination|CustomDestination | undefined
getExportDestinationForm
The form a custom destination shows before export.
getExportDestinationForm(destinationName: ExportDestinationType): AdaptableForm<ExportFormContext> | undefined;Parameters
| Parameter | Type | Description |
|---|---|---|
| destinationName | ExportDestinationType | Destination whose form to read |
Returns
The form, or undefined when the destination has no form
AdaptableForm<ExportFormContext> | undefined
getExportState
The Export section of Adaptable State.
getExportState(): ExportState;Returns
Reports, the selected report and format, and scheduled reports
getReportById
Retrieves Report by Id
getReportById(id: Report['Uuid']): Report;Parameters
| Parameter | Type | Description |
|---|---|---|
| id | Report['Uuid'] | report id |
Returns
report
getReportByName
Retrieves Report with the given name
getReportByName(reportName: ReportNameType): Report | undefined;Parameters
| Parameter | Type | Description |
|---|---|---|
| reportName | ReportNameType | report to retrieve |
Returns
report
Report | undefined
getReportData
Gets the data for the Report with the given Name in the given Format
getReportData(reportName: ReportNameType, format: ReportFormatType, config?: {
exportParams?: (defaultExportParams: CustomExportParams) => CustomExportParams;
showProgressIndicator?: boolean;
}): Promise<ExportResultData>;Parameters
| Parameter | Type | Description |
|---|---|---|
| reportName | ReportNameType | name of the report |
| format | ReportFormatType | format of the report |
| config | \{ exportParams?: (defaultExportParams:CustomExportParams) =>CustomExportParams; showProgressIndicator?: boolean; \} | optional configuration |
Returns
The exported rows in the requested format
Promise<ExportResultData>
getScheduledReportById
A scheduled report looked up by its id.
getScheduledReportById(reportScheduleId: ReportSchedule['Uuid']): ReportSchedule | undefined;Parameters
| Parameter | Type | Description |
|---|---|---|
| reportScheduleId | ReportSchedule['Uuid'] | Uuid of the schedule |
Returns
The schedule, or undefined when no schedule has that id
ReportSchedule | undefined
getScheduledReports
Every scheduled report, including suspended ones.
getScheduledReports(): ReportSchedule[];Returns
The schedules
getSupportedExportDestinations
Retrieves the Export Destinations that are supported for the given Report Format
getSupportedExportDestinations(reportFormat: ReportFormatType): ExportDestinationType[];Parameters
| Parameter | Type | Description |
|---|---|---|
| reportFormat | ReportFormatType | Report format to check |
Returns
Destinations that can receive this format
isColumnExportable
Whether a column is included in an export.
isColumnExportable(adaptablColumn: AdaptableColumn): boolean;Parameters
| Parameter | Type | Description |
|---|---|---|
| adaptablColumn | AdaptableColumn | Column to check |
Returns
false when the column is excluded from reports
boolean
isExportDestinationSystem
Whether the destination is one AdapTable provides (Download or Clipboard) rather than a custom destination.
isExportDestinationSystem(destinationName: ExportDestinationType): boolean;Parameters
| Parameter | Type | Description |
|---|---|---|
| destinationName | ExportDestinationType | Destination to check |
Returns
true for a system destination
boolean
openExportSettingsPanel
Open Settings Panel with Export section selected
openExportSettingsPanel(): void;Returns
void
selectFormat
Selects the report format used by the next export.
selectFormat(reportFormat: ReportFormatType | null): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| reportFormat | ReportFormatType | null | Format to select, or null to clear the selection |
Returns
void
selectReport
Selects the Report in the Adaptable State
selectReport(reportName: ReportNameType | null): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| reportName | ReportNameType | null | name of Report to select |
Returns
void
suspendScheduledReport
Stops a schedule from running until it is unsuspended.
suspendScheduledReport(reportSchedule: ReportSchedule): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| reportSchedule | ReportSchedule | Schedule to suspend |
Returns
void
unSuspendScheduledReport
Makes a suspended schedule run again.
unSuspendScheduledReport(reportSchedule: ReportSchedule): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| reportSchedule | ReportSchedule | Schedule to activate |
Returns
void
updateReport
Updates an existing report
updateReport(report: Report): Report;Parameters
| Parameter | Type | Description |
|---|---|---|
| report | Report | report to edit |
Returns
report
updateReports
Replaces the given custom reports in Export State.
updateReports(reports: Report[]): Report[];Parameters
| Parameter | Type | Description |
|---|---|---|
| reports | Report[] | Reports to update, matched by Uuid |
Returns
The updated reports
Report[]