DashboardViewer.BeforeExportDocument Event

Allows you to hide specific dashboard items when printing or exporting the entire dashboard.

Namespace: DevExpress.DashboardWin

Assembly: DevExpress.Dashboard.v19.2.Win.dll


public event BeforeExportDocumentEventHandler BeforeExportDocument
Public Event BeforeExportDocument As BeforeExportDocumentEventHandler

Event Data

The BeforeExportDocument event handler receives an argument of the BeforeExportDocumentEventArgs type. The following properties provide information specific to this event.

Property Description
ExcelExportOptions Gets options related to exporting a dashboard/dashboard item to XLSX/XLS/CSV format.
ExportAction Gets the export action performed by an end-user.
ImageExportOptions Gets export options related to exporting a dashboard/dashboard item to an image.
PdfExportOptions Gets export options related to exporting a dashboard/dashboard item to PDF format.
PrintPreviewOptions Gets options related to printing a dashboard/dashboard item using the Print Preview window.


The BeforeExportDocument event allows you to hide specific dashboard items from the printed or exported document using the BeforeExportDocumentEventArgs.HideItem method overloads. See the example below to learn how to do this.


This example demonstrates how to hide dashboard filter items when a dashboard is exported to PDF and the ExportFilters export option is set to false.

This method can be the used to handle the following events:

using DevExpress.DashboardCommon;
// ...
        dashboardDesigner1.BeforeExportDocument += DashboardDesigner1_BeforeExportDocument;
// ...
    private void DashboardDesigner1_BeforeExportDocument(object sender, BeforeExportDocumentEventArgs e)
        if (e.ExportAction == DashboardExportAction.ExportToPdf &&
            e.PdfExportOptions.ExportFilters == false)
            e.HideItem(item => item is FilterElementDashboardItem ||
            item is DateFilterDashboardItem);


See Also