ASPxDashboard.BeforeExportDocument Event
Allows you to hide specific dashboard items when exporting the entire dashboard.
Namespace: DevExpress.DashboardWeb
Assembly: DevExpress.Dashboard.v24.2.Web.WebForms.dll
NuGet Package: DevExpress.Web.Dashboard
#Declaration
public event BeforeExportDocumentWebEventHandler BeforeExportDocument
#Event Data
The BeforeExportDocument event's data class is BeforeExportDocumentWebEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Dashboard |
Gets the identifier of the current dashboard. |
Excel |
Gets options related to exporting a dashboard/dashboard item to XLSX/XLS/CSV format. |
Export |
Gets the export action performed by a user. |
Image |
Gets export options related to exporting a dashboard/dashboard item as an image. |
Pdf |
Gets export options related to exporting a dashboard/dashboard item to PDF format. |
The event data class exposes the following methods:
Method | Description |
---|---|
Hide |
Hides the dashboard item matching the specified predicate in the exported dashboard. |
Hide |
Hides the dashboard item with the specified name in the exported dashboard. |
#Remarks
The BeforeExportDocument event allows you to hide specific dashboard items from the exported document using the BeforeExportDocumentWebEventArgs.HideItem method overloads. See the example below to learn how to do this.
#Example
The code snippet below shows how to hide specific dashboard items from the exported document using the ASPxDashboard.BeforeExportDocument
event.
protected void ASPxDashboard1_BeforeExportDocument(object sender, DevExpress.DashboardWeb.BeforeExportDocumentWebEventArgs e) {
// Hides a dashboard item with the specified name from the exported document.
e.HideItem("gridDashboardItem1");
// Hides all filter elements from the exported document.
e.HideItem((DashboardItem item) => item is FilterElementDashboardItem);
}