ExportApi

View as Markdown

Reports and scheduled exports: which report and format are selected, where a report can be sent, and running or scheduling an export.

TypeScript
export interface

Methods

MethodReturnsDescription
addScheduledReport(reportSchedule)voidAdds a schedule that runs a report on a cron expression or at one time.
applyScheduledReport(reportSchedule)voidRuns a scheduled export now and records that the job ran.
canExportToCsv()booleanWhether this instance can export to CSV.
canExportToExcel()booleanWhether this instance can export to Excel.
clearFormat()voidSets the Report Format to null
clearReport()voidSets the Report to null
deleteScheduledReport(reportSchedule)voidRemoves a scheduled report.
editScheduledReport(reportSchedule)voidReplaces a scheduled report already in state.
ensureScheduledReportUuids()voidEnsures 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 | undefinedRetrieves currently selected Report in Adaptable State
getCurrentReportFormat()ReportFormatType | undefinedFormat currently selected for export.
getCurrentReportName()ReportNameType | undefinedName of the report currently selected for export.
getCustomReports()Report[]Reports created by the user. System reports are not included.
getDestinationByName(destinationName)SystemExportDestination|CustomDestination | undefinedRetrieves Destination with the given name
getExportDestinationForm(destinationName)AdaptableForm<ExportFormContext> | undefinedThe form a custom destination shows before export.
getExportState()ExportStateThe Export section of Adaptable State.
getReportById(id)ReportRetrieves Report by Id
getReportByName(reportName)Report | undefinedRetrieves 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 | undefinedA 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)booleanWhether a column is included in an export.
isExportDestinationSystem(destinationName)booleanWhether the destination is one AdapTable provides (Download or Clipboard) rather than a custom destination.
openExportSettingsPanel()voidOpen Settings Panel with Export section selected
selectFormat(reportFormat)voidSelects the report format used by the next export.
selectReport(reportName)voidSelects the Report in the Adaptable State
suspendScheduledReport(reportSchedule)voidStops a schedule from running until it is unsuspended.
unSuspendScheduledReport(reportSchedule)voidMakes a suspended schedule run again.
updateReport(report)ReportUpdates 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.

TypeScript
addScheduledReport(reportSchedule: ReportSchedule): void;
Parameters
ParameterTypeDescription
reportScheduleReportScheduleSchedule to add
Returns

void

applyScheduledReport

Runs a scheduled export now and records that the job ran.

TypeScript
applyScheduledReport(reportSchedule: ReportSchedule): void;
Parameters
ParameterTypeDescription
reportScheduleReportScheduleSchedule to run
Returns

void

canExportToCsv

Whether this instance can export to CSV.

TypeScript
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.

TypeScript
canExportToExcel(): boolean;
Returns

false when Excel export is turned off. The Excel destination is then hidden

boolean

clearFormat

Sets the Report Format to null

TypeScript
clearFormat(): void;
Returns

void

clearReport

Sets the Report to null

TypeScript
clearReport(): void;
Returns

void

deleteScheduledReport

Removes a scheduled report.

TypeScript
deleteScheduledReport(reportSchedule: ReportSchedule): void;
Parameters
ParameterTypeDescription
reportScheduleReportScheduleSchedule to delete
Returns

void

editScheduledReport

Replaces a scheduled report already in state.

TypeScript
editScheduledReport(reportSchedule: ReportSchedule): void;
Parameters
ParameterTypeDescription
reportScheduleReportScheduleSchedule to save, matched by Uuid
Returns

void

ensureScheduledReportUuids

Ensures every scheduled report has a unique Uuid (legacy state may omit them).

TypeScript
ensureScheduledReportUuids(): void;
Returns

void

exportReport

Exports the Report with the given Name and Format to the given Destination

TypeScript
exportReport(reportName: ReportNameType, format: ReportFormatType, destination?: ExportDestinationType, exportConfig?: ExportConfig): Promise<void>;
Parameters
ParameterTypeDescription
reportNameReportNameTypename of the report
formatReportFormatTypeformat of the report
destinationExportDestinationTypedestination to export to
exportConfigExportConfigoptional export configuration
Returns

Promise<void>

getActiveScheduledReports

Scheduled reports that are not suspended.

TypeScript
getActiveScheduledReports(): ReportSchedule[];
Returns

The active schedules

ReportSchedule[]

getAllExportDestinations

Retrieves the available export destinations

TypeScript
getAllExportDestinations(): ExportDestinationType[];
Returns

export destinations

ExportDestinationType[]

getAllFormats

Every report format that can be selected, system and custom.

TypeScript
getAllFormats(): ReportFormatType[];
Returns

The format names

ReportFormatType[]

getAllReports

Retrieves all available Reports - System and User-created Reports

TypeScript
getAllReports(): Report[];
Returns

reports

Report[]

getAvailableCustomDestinations

Custom destinations supplied in Export Options.

TypeScript
getAvailableCustomDestinations(): CustomDestination[];
Returns

The custom destinations. Empty when none are configured

CustomDestination[]

getAvailableSystemDestinations

System destinations that Export Options allow.

TypeScript
getAvailableSystemDestinations(): SystemExportDestination[];
Returns

'Download' and 'Clipboard', limited to those enabled in Export Options

SystemExportDestination[]

getAvailableSystemFormats

System report formats that Export Options allow.

TypeScript
getAvailableSystemFormats(): SystemReportFormat[];
Returns

'Excel', 'VisualExcel', 'CSV' and 'JSON', limited to those enabled in Export Options

SystemReportFormat[]

getAvailableSystemReports

System report names that Export Options allow.

TypeScript
getAvailableSystemReports(): SystemReportName[];
Returns

'All Data', 'Current Layout' and 'Selected Data', limited to those enabled in Export Options

SystemReportName[]

getCurrentReport

Retrieves currently selected Report in Adaptable State

TypeScript
getCurrentReport(): Report | undefined;
Returns

report that is currently selected

Report | undefined

getCurrentReportFormat

Format currently selected for export.

TypeScript
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.

TypeScript
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.

TypeScript
getCustomReports(): Report[];
Returns

The custom reports

Report[]

getDestinationByName

Retrieves Destination with the given name

TypeScript
getDestinationByName(destinationName: ExportDestinationType): SystemExportDestination | CustomDestination | undefined;
Parameters
ParameterTypeDescription
destinationNameExportDestinationTypedestination to retrieve
Returns

export destination

SystemExportDestination|CustomDestination | undefined

getExportDestinationForm

The form a custom destination shows before export.

TypeScript
getExportDestinationForm(destinationName: ExportDestinationType): AdaptableForm<ExportFormContext> | undefined;
Parameters
ParameterTypeDescription
destinationNameExportDestinationTypeDestination 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.

TypeScript
getExportState(): ExportState;
Returns

Reports, the selected report and format, and scheduled reports

ExportState

getReportById

Retrieves Report by Id

TypeScript
getReportById(id: Report['Uuid']): Report;
Parameters
ParameterTypeDescription
idReport['Uuid']report id
Returns

report

Report

getReportByName

Retrieves Report with the given name

TypeScript
getReportByName(reportName: ReportNameType): Report | undefined;
Parameters
ParameterTypeDescription
reportNameReportNameTypereport to retrieve
Returns

report

Report | undefined

getReportData

Gets the data for the Report with the given Name in the given Format

TypeScript
getReportData(reportName: ReportNameType, format: ReportFormatType, config?: {
        exportParams?: (defaultExportParams: CustomExportParams) => CustomExportParams;
        showProgressIndicator?: boolean;
    }): Promise<ExportResultData>;
Parameters
ParameterTypeDescription
reportNameReportNameTypename of the report
formatReportFormatTypeformat 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.

TypeScript
getScheduledReportById(reportScheduleId: ReportSchedule['Uuid']): ReportSchedule | undefined;
Parameters
ParameterTypeDescription
reportScheduleIdReportSchedule['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.

TypeScript
getScheduledReports(): ReportSchedule[];
Returns

The schedules

ReportSchedule[]

getSupportedExportDestinations

Retrieves the Export Destinations that are supported for the given Report Format

TypeScript
getSupportedExportDestinations(reportFormat: ReportFormatType): ExportDestinationType[];
Parameters
ParameterTypeDescription
reportFormatReportFormatTypeReport format to check
Returns

Destinations that can receive this format

ExportDestinationType[]

isColumnExportable

Whether a column is included in an export.

TypeScript
isColumnExportable(adaptablColumn: AdaptableColumn): boolean;
Parameters
ParameterTypeDescription
adaptablColumnAdaptableColumnColumn 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.

TypeScript
isExportDestinationSystem(destinationName: ExportDestinationType): boolean;
Parameters
ParameterTypeDescription
destinationNameExportDestinationTypeDestination to check
Returns

true for a system destination

boolean

openExportSettingsPanel

Open Settings Panel with Export section selected

TypeScript
openExportSettingsPanel(): void;
Returns

void

selectFormat

Selects the report format used by the next export.

TypeScript
selectFormat(reportFormat: ReportFormatType | null): void;
Parameters
ParameterTypeDescription
reportFormatReportFormatType | nullFormat to select, or null to clear the selection
Returns

void

selectReport

Selects the Report in the Adaptable State

TypeScript
selectReport(reportName: ReportNameType | null): void;
Parameters
ParameterTypeDescription
reportNameReportNameType | nullname of Report to select
Returns

void

suspendScheduledReport

Stops a schedule from running until it is unsuspended.

TypeScript
suspendScheduledReport(reportSchedule: ReportSchedule): void;
Parameters
ParameterTypeDescription
reportScheduleReportScheduleSchedule to suspend
Returns

void

unSuspendScheduledReport

Makes a suspended schedule run again.

TypeScript
unSuspendScheduledReport(reportSchedule: ReportSchedule): void;
Parameters
ParameterTypeDescription
reportScheduleReportScheduleSchedule to activate
Returns

void

updateReport

Updates an existing report

TypeScript
updateReport(report: Report): Report;
Parameters
ParameterTypeDescription
reportReportreport to edit
Returns

report

Report

updateReports

Replaces the given custom reports in Export State.

TypeScript
updateReports(reports: Report[]): Report[];
Parameters
ParameterTypeDescription
reportsReport[]Reports to update, matched by Uuid
Returns

The updated reports

Report[]