Export Technical Reference

Summary

  • The Live Data Changed Event is fired when data is changed in a Live Report (e.g. ipushpull)
  • The Export API contains functions to manage exporting and reports programmatically

Export State

The Export section of Initial Adaptable State contains details of the current Report and Report Format Type, and a collection of User-provided Report objects:

PropertyTypeDescription
CurrentFormatReportFormatTypeSelected Report Format - in Export Toolbar & Tool Panel
CurrentReportReportNameTypeSelected Report Type - in Export Toolbar & Tool Panel
ReportsReport[]User-created Reports; each has Name and Row and Column Scope
ReportSchedulesReportSchedule[]Scheduled Exports for System and Custom Reports

Report

The Report object is defined as follows:

PropertyTypeDescription
NameReportNameTypeName of the Report as displayed in the Export toolbar and tool panel
QueryAdaptableBooleanQueryQuery to use; only required if ReportRowScope is 'ExpressionRows'
ReportColumnScopeReportColumnScopeColumns to display: AllColumns, VisibleColumns, SelectedColumns, ScopeColumns
ReportRowScopeReportRowScopeRows to export: AllRows, VisibleRows, SelectedRows, ExpressionRows
ScopeColumnScopeColumns Scope; only required if ReportColumnScope is 'ScopeColumns'
IsReadOnlybooleanSets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')

Schedules

The ReportSchedule object contains information about the object being scheduled and is defined as follows:

PropertyTypeDescription
ExportDestinationExportDestinationTypeDestination of Report to run on Schedule
NamestringUnique display name for this scheduled report
ReportFormatReportFormatTypeFormat of Report to run on Schedule
ReportNameReportNameTypeName of Report to export
ScheduleScheduleWhen the export should run
IsReadOnlybooleanSets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')
IsSuspendedbooleanSuspends (i.e. turns off) an Adaptable Object

The actual scheduling is provided in the Schedule object, which is defined as follows:

PropertyTypeDescription
CronExpressionstringStandard 5-field cron (minute hour day-of-month month day-of-week); e.g. weekdays at 09:30 → 30 9 * * 1-5
IsOneOffbooleanIf true, the schedule runs once (using RunAt)
RunAtstringISO datetime for a one-off run (local time); set when IsOneOff is true

Export Options

The Export Options section of Adaptable Options contains these properties:

PropertyTypeDescriptionDefault
appendFileTimestampbooleanWhether to add a timestamp as a suffix to exported file namefalse
csvSeparatorstring | ((csvSeparatorContext:BaseExportContext) => string)Separator for CSV exports','
customDestinationsCustomDestination[] | ((context:CustomDestinationsContext) =>CustomDestination[])User-provided Report Destinations (in addition to those shipped in AdapTable)
excelSheetNamestring | ((excelSheetNameContext:BaseExportContext) => string)Provides a custom name for the Excel sheet when exporting to Excel'Sheet 1'
exportDataFormatDataFormatType|DataFormatDataType| ((context:ExportDataFormatContext<TData>) =>DataFormatType)Sets 'rawValue' or 'formattedValue' as Data format in Reports; can be set for whole grid, per Data Type, or per Column (via a function)rawValue
exportDateFormatstring | ((context:ExportDateFormatContext<TData>) => string)Optional custom format for Date columns when exportingundefined
getDetailRows(context:GetDetailRowsContext<TData>) => CsvDetailRow[] | ExcelDetailRow[] | undefinedFunction to provide the Detail Rows when exporting in Master-Detail grids. This function will be invoked for each master row node.
isColumnExportable(context:AdaptableColumnContext) => booleanWhether a Column is included in System Reports and available in UI for selectiontrue
processExport(processExportContext:ProcessExportContext) => Promise<ExportResultData | boolean>Provides custom handling of the Export process before the default export is executed.
reportFilename(reportFileNameContext:ReportFileNameContext) => stringProvide a bespoke file name for the Report
skipColumnHeadersboolean | ((skipColumnHeadersContext:BaseExportContext) => boolean)Whether to exclude Column Headers from the exported datafalse
systemExportDestinationsSystemExportDestination[] | ((context:SystemExportDestinationsContext) =>SystemExportDestination[])Export destinations to use; leave unset for all, empty array for none'Download', 'Clipboard'
systemReportFormatsSystemReportFormat[] | ((context:SystemReportFormatsContext) =>SystemReportFormat[])System Report Formats to use; leave unset for all, empty array for none'Excel', 'VisualExcel', 'CSV', 'JSON'
systemReportNamesSystemReportName[] | ((context:SystemReportNamesContext) =>SystemReportName[])System Reports to use; leave unset for all, empty array for none'All Data', 'Current Layout', 'Selected Data',

Export API

The Export API section of Adaptable API contains a number of functions enabling Reports to be run - and managed more generally - at run-time:

MethodReturnsDescription
addScheduledReport(reportSchedule)voidAdds a scheduled report
applyScheduledReport(reportSchedule)voidRuns a scheduled export and records the job-run action
canExportToCsv()booleanIf this AdapTable instance can to export to CSV; if false, the Export to Csv option will not be visible
canExportToExcel()booleanIf this AdapTable instance can to export to Excel; if false, the Export to Excel option will not be visible
clearFormat()voidSets the Report Format to null
clearReport()voidSets the Report to null
deleteScheduledReport(reportSchedule)voidDeletes a scheduled report
editScheduledReport(reportSchedule)voidEdits a scheduled report
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(config)ReportSchedule[]All active scheduled reports (custom reports and system reports)
getAllExportDestinations()ExportDestinationType[]Retrieves the available export destinations
getAllFormats()ReportFormatType[]Retrieves all Report Formats that are available
getAllReports()Report[]Retrieves all available Reports - System and User-created Reports
getAvailableCustomDestinations()CustomDestination[]Retrieves available Custom Destinations (configured in Export Options)
getAvailableSystemDestinations()SystemExportDestination[]Retrieves available System Export Destinations (configured in Export Options)
getAvailableSystemFormats()SystemReportFormat[]Retrieves available System Report Formats (configured in Export Options)
getAvailableSystemReports()SystemReportName[]Retrieves available System Reports (configured in Export Options)
getCurrentReport()Report | undefinedRetrieves currently selected Report in Adaptable State
getCurrentReportFormat()ReportFormatType | undefinedRetrieves name of currently selected Report
getCurrentReportName()ReportNameType | undefinedRetrieves name of currently selected Report
getCustomReports()Report[]Retrieves all Custom Reports that have been created by the User
getDestinationByName(destinationName)SystemExportDestination|CustomDestination | undefinedRetrieves Destination with the given name
getExportDestinationForm(destinationName)AdaptableForm<ExportFormContext> | undefinedForm Data entered by the User in the UI for a Custom Destination
getExportState()ExportStateRetrieves Export section from 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, config)ReportSchedule | undefinedRetrieves a scheduled report by its Uuid
getScheduledReports(config)ReportSchedule[]All scheduled reports (custom reports and system reports)
getSupportedExportDestinations(reportFormat)ExportDestinationType[]Retrieves the Export Destinations that are supported for the given Report Format
isColumnExportable(adaptablColumn)booleanReturns whether the given column is exportable
isExportDestinationSystem(destinationName)booleanIf the given destination is a System one
openExportSettingsPanel()voidOpen Settings Panel with Export section selected
selectFormat(reportFormat)voidSelects the Report Format for Export
selectReport(reportName)voidSelects the Report in the Adaptable State
suspendScheduledReport(reportSchedule)voidSuspends a scheduled report
unSuspendScheduledReport(reportSchedule)voidUnsuspends a scheduled report
updateReport(report)ReportUpdates an existing report
updateReports(reports)Report[]Updates existing reports

Report Schedule Ran Event

The Report Schedule Ran Event is published whenever any report runs on a Schedule.

The ReportScheduleRanInfo provides full information on the Report and the Schedule:

PropertyTypeDescription
RanAtstringISO datetime when Schedule ran (useful for logging)
reportScheduleReportScheduleReport schedule that was triggered (if applicable)
adaptableContextanyCustom application Context provided in AdaptableOptions.adaptableContext

Live Data Changed Event

The Live Data Changed Event is published whenever any report which contains Live Data (i.e. if using ipushpull or OpenFin plugins) is changed.

Live Report

The Live Report defines which Adaptable Reports are 'Live' (i.e. they will update the destination as the data in Adaptable ticks or changes):

Note

When Adaptable creates a Live Report it will take care of updating the destination as the data in the Report changes (based on the throttle time it is given).

PropertyTypeDescription
pageNamestringFor OpenFin this is the workbook name; for iPushpull the page name
reportReportThe underlying Report
reportDestination'OpenfinExcel' | 'ipushpull'Where the live data is being sent