The requested page is not available for the requested platform. You are viewing the content for Default platform.

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.

See the Extension section for information on how to use the HTML JavaScript Dashboard's client-side API.

The table below displays client-side API you can use to configure export options:

Export Type

DashboardExportExtension

DashboardExportExtensionOptions

Common

DashboardExportExtension.allowExportDashboard

DashboardExportExtension.allowExportDashboardItems

DashboardExportExtension.showExportDashboardDialog

DashboardExportExtension.showExportDashboardItemDialog

DashboardExportExtensionOptions.allowExportDashboard

DashboardExportExtensionOptions.allowExportDashboardItems

DashboardExportExtensionOptions.onExportDialogHidden

DashboardExportExtensionOptions.onExportDialogShowing

DashboardExportExtensionOptions.onExportDialogShown

Excel

DashboardExportExtension.getExcelExportOptions

DashboardExportExtension.setExcelExportOptions

DashboardExportExtension.exportToExcel

DashboardExportExtension.exportDashboardItemToExcel

DashboardExportExtensionOptions.excelExportOptions

Pdf

DashboardExportExtension.getPdfExportOptions

DashboardExportExtension.setPdfExportOptions

DashboardExportExtension.exportToPdf

DashboardExportExtension.exportDashboardItemToPdf

DashboardExportExtensionOptions.pdfExportOptions

Image

DashboardExportExtension.getImageExportOptions

DashboardExportExtension.setImageExportOptions

DashboardExportExtension.exportToImage

DashboardExportExtension.exportDashboardItemToImage

DashboardExportExtensionOptions.imageExportOptions

Implements

constructor(dashboardControl)

Initializes a new instance of the DashboardExportExtension class.

Declaration

constructor(dashboardControl: DashboardControl, options?: DashboardExportExtensionOptions)

Parameters

Name Type Description
dashboardControl DashboardControl

A Web Dashboard control that owns the extension.

Optional Parameters

Name Type Default Description
options DashboardExportExtensionOptions null

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

Name Type Description
itemName string

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

Optional Parameters

Name Type Default Description
options DashboardExcelExportOptions null

A DashboardExcelExportOptions object containing PDF-specific export options.

fileName string null

A string that specifies the name of the exported file.

See Also

exportDashboardItemToImage(itemName) Method

Exports a dashboard item to an image.

Declaration

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

Parameters

Name Type Description
itemName string

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

Optional Parameters

Name Type Default Description
options DashboardImageExportOptions null

A DashboardImageExportOptions object containing PDF-specific export options.

fileName string null

A string that specifies the name of the exported file.

See Also

exportDashboardItemToPdf(itemName) Method

Exports a dashboard item to a PDF file.

Declaration

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

Parameters

Name Type Description
itemName string

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

Optional Parameters

Name Type Default Description
options DashboardPdfExportOptions null

A DashboardPdfExportOptions object containing PDF-specific export options.

fileName string null

A string that specifies the name of the exported file.

See Also

exportToExcel Method

Exports the entire dashboard to an Excel file.

Declaration

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

Optional Parameters

Name Type Default Description
options DashboardExcelExportOptions null

A DashboardExcelExportOptions object containing Excel-specific options.

fileName string null

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

See Also

exportToImage Method

Exports the entire dashboard to an image.

Declaration

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

Optional Parameters

Name Type Default Description
options DashboardImageExportOptions null

A DashboardImageExportOptions object containing image-specific export options.

fileName string null

A string that specifies the name of the exported file.

See Also

exportToPdf Method

Exports the entire dashboard to a PDF file.

Declaration

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

Optional Parameters

Name Type Default Description
options DashboardPdfExportOptions null

A DashboardPdfExportOptions object containing PDF-specific export options.

fileName string null

A string that specifies the name of the exported file.

See Also

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.

Remarks

Use the getExcelExportOptions method to get the current excel export options instance. Configure the instance and use the DashboardExportExtension.setExcelExportOptions(options) method to reassign options:

var exportExtension = <DashboardExportExtension>this.dashboardControl.findExtension("dashboard-export");
var excelExportOptions = exportExtension.getExcelExportOptions();
excelExportOptions.Format = "Xlsx";
excelExportOptions.DashboardStatePosition = "SeparateSheet";
exportExtension.setExcelExportOptions(excelExportOptions);

this.dashboardControl.render();

Use the DashboardExportExtensionOptions.excelExportOptions property to configure Excel export options when you initialize a dashboard control instance.

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.

Remarks

Use the getImageExportOptions method to get the current image export options instance. Configure the instance and use the DashboardExportExtension.setImageExportOptions method to reassign options:

var exportExtension = <DashboardExportExtension>this.dashboardControl.findExtension("dashboard-export");
var imageExportOptions = exportExtension.getImageExportOptions();
imageExportOptions.Format = "Png";
imageExportOptions.FontInfo.UseCustomFontInfo = true;
imageExportOptions.FontInfo.Name = "Arial Black";
imageExportOptions.FontInfo.GdiCharSet = 1;
exportExtension.setImageExportOptions(imageExportOptions);

this.dashboardControl.render();  

Use the DashboardExportExtensionOptions.imageExportOptions property to configure image export options when you initialize a dashboard control instance.

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.

Remarks

Use the getPdfExportOptions method to get the current pdf export options instance. Configure the instance and use the DashboardExportExtension.setPdfExportOptions method to reassign options:

var exportExtension = <DashboardExportExtension>this.dashboardControl.findExtension("dashboard-export");
var pdfExportOptions = exportExtension.getPdfExportOptions();
pdfExportOptions.FontInfo.UseCustomFontInfo = true;
pdfExportOptions.FontInfo.Name = "Arial Black";
pdfExportOptions.FontInfo.GdiCharSet = 1;
exportExtension.setPdfExportOptions(pdfExportOptions);

this.dashboardControl.render();  

Use the DashboardExportExtensionOptions.pdfExportOptions property to configure pdf export options when you initialize a dashboard control instance.

See Also

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

Name Type Description
options DashboardExcelExportOptions

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

Remarks

Use the DashboardExportExtension.getExcelExportOptions method to get the current Excel export options instance. Configure the instance and use the setExcelExportOptions method to reassign options:

var exportExtension = <DashboardExportExtension>this.dashboardControl.findExtension("dashboard-export");
var excelExportOptions = exportExtension.getExcelExportOptions();
excelExportOptions.Format = "Xlsx";
excelExportOptions.DashboardStatePosition = "SeparateSheet";
exportExtension.setExcelExportOptions(excelExportOptions);

this.dashboardControl.render();

Use the DashboardExportExtensionOptions.excelExportOptions property to configure Excel export options when you initialize a dashboard control instance.

setImageExportOptions(options) Method

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

Declaration

setImageExportOptions(options: DashboardImageExportOptions): void

Parameters

Name Type Description
options DashboardImageExportOptions

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

Remarks

Use the DashboardExportExtension.getImageExportOptions method to get the current image export options instance. Configure the instance and use the setImageExportOptions method to reassign options:

var exportExtension = <DashboardExportExtension>this.dashboardControl.findExtension("dashboard-export");
var imageExportOptions = exportExtension.getImageExportOptions();
imageExportOptions.Format = "Png";
imageExportOptions.FontInfo.UseCustomFontInfo = true;
imageExportOptions.FontInfo.Name = "Arial Black";
imageExportOptions.FontInfo.GdiCharSet = 1;
exportExtension.setImageExportOptions(imageExportOptions);

this.dashboardControl.render();

Use the DashboardExportExtensionOptions.imageExportOptions property to configure image export options when you initialize a dashboard control instance.

setPdfExportOptions(options) Method

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

Declaration

setPdfExportOptions(options: DashboardPdfExportOptions): void

Parameters

Name Type Description
options DashboardPdfExportOptions

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

Remarks

Use the DashboardExportExtension.getPdfExportOptions method to get the current pdf export options instance. Configure the instance and use the setPdfExportOptions method to reassign options:

var exportExtension = <DashboardExportExtension>this.dashboardControl.findExtension("dashboard-export");
var pdfExportOptions = exportExtension.getPdfExportOptions();
pdfExportOptions.FontInfo.UseCustomFontInfo = true;
pdfExportOptions.FontInfo.Name = "Arial Black";
pdfExportOptions.FontInfo.GdiCharSet = 1;
exportExtension.setPdfExportOptions(pdfExportOptions);

this.dashboardControl.render();  

Use the DashboardExportExtensionOptions.pdfExportOptions property to configure pdf export options when you initialize a dashboard control instance.

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

Name Type Description
format DashboardExportFormat

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

Name Type Description
itemComponentName string

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

format DashboardExportFormat

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