DashboardExportExtension Class

A Web Dashboard extension that allows you to export dashboards and dashboard items.

Declaration

export class DashboardExportExtension implements IExtension

Remarks

To configure the extension, refer to the DashboardExportExtensionOptions class that contains the Web Dashboard control's export options.

Implements

constructor(dashboardControl)

Initializes a new instance of the DashboardExportExtension class.

Declaration

constructor(dashboardControl: DashboardControl, options?: DashboardExportExtensionOptions)

Parameters

Type Name Description
DashboardControl dashboardControl

A Web Dashboard control that owns the extension.

DashboardExportExtensionOptions options

A DashboardExportExtensionOptions object that contains the extension options.

Properties

allowExportDashboard Property

Specifies whether end-users can export a dashboard.

Declaration

allowExportDashboard: boolean

Property Value

Type Description
boolean

true, if end-users can export a dashboard; otherwise, false.

Remarks

Use the allowExportDashboardItems property to allow or disallow export of dashboard items.

allowExportDashboardItems Property

Specifies whether end-users can export dashboard items.

Declaration

allowExportDashboardItems: boolean

Property Value

Type Description
boolean

true, if end-users can export dashboard items; otherwise, false.

Remarks

Use the allowExportDashboard property to allow or disallow export of the entire dashboard.

name Property

Specifies a unique extension name.

Declaration

name: string

Property Value

Type Description
string

A unique extension name. The return value is 'dashboard-export'.

Remarks

Warning

Do not change a unique name of the extension registered in the Web Dashboard in order to avoid exceptions.

Methods

exportDashboardItemToExcel(itemName) Method

Exports a dashboard item to an Excel file.

Declaration

exportDashboardItemToExcel(itemName: string, options?: DashboardExcelExportOptions, fileName?: string): void

Parameters

Type Name Description
string itemName

A string that is the component name of the dashboard item to be exported.

DashboardExcelExportOptions options

A DashboardExcelExportOptions object containing PDF-specific export options.

string fileName

A string that specifies the name of the exported file.

exportDashboardItemToImage(itemName) Method

Exports a dashboard item to an image.

Declaration

exportDashboardItemToImage(itemName: string, options?: DashboardImageExportOptions, fileName?: string): void

Parameters

Type Name Description
string itemName

A string that is the component name of the dashboard item to be exported.

DashboardImageExportOptions options

A DashboardImageExportOptions object containing PDF-specific export options.

string fileName

A string that specifies the name of the exported file.

exportDashboardItemToPdf(itemName) Method

Exports a dashboard item to a PDF file.

Declaration

exportDashboardItemToPdf(itemName: string, options?: DashboardPdfExportOptions, fileName?: string): void

Parameters

Type Name Description
string itemName

A string that is the component name of the dashboard item to be exported.

DashboardPdfExportOptions options

A DashboardPdfExportOptions object containing PDF-specific export options.

string fileName

A string that specifies the name of the exported file.

exportToExcel Method

Exports the entire dashboard to an Excel file.

Declaration

exportToExcel(options?: DashboardExcelExportOptions, fileName?: string): void

Parameters

Type Name Description
DashboardExcelExportOptions options

A DashboardExcelExportOptions object containing Excel-specific options.

string fileName

A string value that specifies the name of the exported file.

exportToImage Method

Exports the entire dashboard to an image.

Declaration

exportToImage(options?: DashboardImageExportOptions, fileName?: string): void

Parameters

Type Name Description
DashboardImageExportOptions options

A DashboardImageExportOptions object containing image-specific export options.

string fileName

A string that specifies the name of the exported file.

exportToPdf Method

Exports the entire dashboard to a PDF file.

Declaration

exportToPdf(options?: DashboardPdfExportOptions, fileName?: string): void

Parameters

Type Name Description
DashboardPdfExportOptions options

A DashboardPdfExportOptions object containing PDF-specific export options.

string fileName

A string that specifies the name of the exported file.

getExcelExportOptions Method

Returns options related to exporting a dashboard/dashboard item to the Excel format.

Declaration

getExcelExportOptions(): DashboardExcelExportOptions

Returns

Type Description
DashboardExcelExportOptions

A DashboardExcelExportOptions object containing options related to exporting a dashboard item to the Excel format.

getImageExportOptions Method

Returns options related to exporting a dashboard/dashboard item to the Image format.

Declaration

getImageExportOptions(): DashboardImageExportOptions

Returns

Type Description
DashboardImageExportOptions

A DashboardImageExportOptions object containing options related to exporting a dashboard item to the Image format.

getPdfExportOptions Method

Returns options related to exporting a dashboard/dashboard item to the PDF format.

Declaration

getPdfExportOptions(): DashboardPdfExportOptions

Returns

Type Description
DashboardPdfExportOptions

A DashboardPdfExportOptions object containing options related to exporting a dashboard item to the PDF format.

hideExportDialog Method

Hides the dialog that allows end-users to export the dashboard/dashboard item.

Declaration

hideExportDialog(): void

Remarks

To show the export dialog for the dashboard/dashboard item, use the showExportDashboardDialog(format) and showExportDashboardItemDialog(itemComponentName, format) methods, respectively.

setExcelExportOptions(options) Method

Sets options related to exporting a dashboard/dashboard item to the Excel format.

Declaration

setExcelExportOptions(options: DashboardExcelExportOptions): void

Parameters

Type Name Description
DashboardExcelExportOptions options

A DashboardExcelExportOptions object containing options related to exporting a dashboard item to the Excel format.

setImageExportOptions(options) Method

Sets options related to exporting a dashboard/dashboard item to the Image format.

Declaration

setImageExportOptions(options: DashboardImageExportOptions): void

Parameters

Type Name Description
DashboardImageExportOptions options

A DashboardImageExportOptions object containing options related to exporting a dashboard item to the Image format.

setPdfExportOptions(options) Method

Sets options related to exporting a dashboard/dashboard item to the PDF format.

Declaration

setPdfExportOptions(options: DashboardPdfExportOptions): void

Parameters

Type Name Description
DashboardPdfExportOptions options

A DashboardPdfExportOptions object containing options related to exporting a dashboard item to the PDF format.

showExportDashboardDialog(format) Method

Invokes the dialog that allows end-users to export the entire dashboard to the specified format.

Declaration

showExportDashboardDialog(format: DashboardExportFormat): void

Parameters

Type Name Description
DashboardExportFormat format

A DashboardExportFormat value that specifies the export format.

Remarks

Use the showExportDashboardItemDialog(itemComponentName, format) method to show the export dialog for the specified dashboard item. The hideExportDialog method allows you to hide the opened export dialog.

showExportDashboardItemDialog(itemComponentName, format) Method

Invokes the dialog that allows end users to export the dashboard item to the specified format.

Declaration

showExportDashboardItemDialog(itemComponentName: string, format: DashboardExportFormat): void

Parameters

Type Name Description
string itemComponentName

A string value that specifies the component name of the dashboard item to export.

DashboardExportFormat format

A DashboardExportFormat value that specifies the export format.

Remarks

Use the showExportDashboardDialog(format) method to show the export dialog for the entire dashboard. The hideExportDialog method allows you to hide the opened export dialog.

Warning

Note that some items (i.e., Text Box or Image dashboard items) do not support exporting to the Excel format.

start Method

Contains code that is executed when you register the dashboard extension.

Declaration

start(): void

stop Method

Contains code that is executed when you unregister the dashboard extension.

Declaration

stop(): void