Skip to main content

DashboardExportExtension Class

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

Declaration

export class DashboardExportExtension implements ISupportOptionExtension<DashboardExportExtensionOptions>

Remarks

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

See the following topic for information on how to use the DashboardControl’s client-side API: Extensions Overview.

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

ISupportOptionExtension

constructor(dashboardControl)

Initializes a new instance of the DashboardExportExtension class.

Declaration

constructor(
    dashboardControl: DevExpress.Dashboard.DashboardControl,
    options?: DashboardExportExtensionOptions
)

Parameters

Name Type Description
dashboardControl DashboardControl

A Web Dashboard control that owns the extension.

options DashboardExportExtensionOptions

A DashboardExportExtensionOptions object that contains the extension options.

Properties

allowExportDashboard Property

Specifies whether a user can export a dashboard.

Declaration

get allowExportDashboard(): any
set allowExportDashboard(value: any)

Property Value

Type
any

Remarks

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

allowExportDashboardItems Property

Specifies whether a user can export dashboard items.

Declaration

get allowExportDashboardItems(): any
set allowExportDashboardItems(value: any)

Property Value

Type
any

Remarks

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

name Property

Specifies the unique extension name.

Declaration

name: string

Property Value

Type Description
string

The unique extension name. The return value is dashboardExport.

Remarks

Use the dashboardExport name in the following cases:

  • Call the DashboardControl.findExtension method and pass the extension name as a parameter to access the extension.
  • Call the control’s option method to change the extension options.

Warning

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

off Property

Unsubscribes from the DashboardExportExtension’s events.

Declaration

off: DevExpress.Dashboard.Internal.EventSubscriber<DashboardExportExtensionEvents>

Property Value

Type Description
EventSubscriber<DashboardExportExtensionEvents>

An event subscription.

on Property

Subscribes to DashboardExportExtension events.

Declaration

on: DevExpress.Dashboard.Internal.EventSubscriber<DashboardExportExtensionEvents>

Property Value

Type Description
EventSubscriber<DashboardExportExtensionEvents>

An event subscription.

Remarks

The extension’s on and off methods help you subscribe to and unsubscribe from events.

Methods

exportDashboardItemToExcel(itemName) Method

Exports a dashboard item to an Excel file.

Declaration

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

Parameters

Name Type Description
itemName string

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

options DashboardExcelExportOptions

A DashboardExcelExportOptions object containing PDF-specific export options.

fileName string

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?: DevExpress.Dashboard.DashboardImageExportOptions,
    fileName?: string
): void

Parameters

Name Type Description
itemName string

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

options DashboardImageExportOptions

A DashboardImageExportOptions object containing PDF-specific export options.

fileName string

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?: DevExpress.Dashboard.DashboardPdfExportOptions,
    fileName?: string
): void

Parameters

Name Type Description
itemName string

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

options DashboardPdfExportOptions

A DashboardPdfExportOptions object containing PDF-specific export options.

fileName string

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?: DevExpress.Dashboard.DashboardExcelExportOptions,
    fileName?: string
): void

Parameters

Name Type Description
options DashboardExcelExportOptions

A DashboardExcelExportOptions object containing Excel-specific options.

fileName string

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?: DevExpress.Dashboard.DashboardImageExportOptions,
    fileName?: string
): void

Parameters

Name Type Description
options DashboardImageExportOptions

A DashboardImageExportOptions object containing image-specific export options.

fileName string

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?: DevExpress.Dashboard.DashboardPdfExportOptions,
    fileName?: string
): void

Parameters

Name Type Description
options DashboardPdfExportOptions

A DashboardPdfExportOptions object containing PDF-specific export options.

fileName string

A string that specifies the name of the exported file.

See Also

getExcelExportOptions Method

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

Declaration

getExcelExportOptions(): DevExpress.Dashboard.DashboardExcelExportOptions

Returns

Type Description
DashboardExcelExportOptions

A DashboardExcelExportOptions object containing options related to exporting a dashboard item to 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("dashboardExport");
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(): DevExpress.Dashboard.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("dashboardExport");
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 PDF format.

Declaration

getPdfExportOptions(): DevExpress.Dashboard.DashboardPdfExportOptions

Returns

Type Description
DashboardPdfExportOptions

A DashboardPdfExportOptions object containing options related to exporting a dashboard item to 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("dashboardExport");
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 Excel format.

Declaration

setExcelExportOptions(
    options: DevExpress.Dashboard.DashboardExcelExportOptions
): void

Parameters

Name Type Description
options DashboardExcelExportOptions

A DashboardExcelExportOptions object containing options related to exporting a dashboard item to 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("dashboardExport");
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: DevExpress.Dashboard.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("dashboardExport");
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 PDF format.

Declaration

setPdfExportOptions(
    options: DevExpress.Dashboard.DashboardPdfExportOptions
): void

Parameters

Name Type Description
options DashboardPdfExportOptions

A DashboardPdfExportOptions object containing options related to exporting a dashboard item to 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("dashboardExport");
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 (for example, 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