dashboard-devexpress-dot-dashboardweb-dot-dashboardconfigurator-19e2f597.md
Allows you to hide specific dashboard items when exporting the entire dashboard.
Namespace : DevExpress.DashboardWeb
Assembly : DevExpress.Dashboard.v25.2.Web.dll
NuGet Package : DevExpress.Web.Dashboard.Common
public event BeforeExportDocumentWebEventHandler BeforeExportDocument
Public Event BeforeExportDocument As BeforeExportDocumentWebEventHandler
The BeforeExportDocument event's data class is BeforeExportDocumentWebEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| DashboardId | Gets the identifier of the current dashboard. |
| ExcelExportOptions | Gets options related to exporting a dashboard/dashboard item to XLSX/XLS/CSV format. |
| ExportAction | Gets the export action performed by a user. |
| ImageExportOptions | Gets export options related to exporting a dashboard/dashboard item as an image. |
| PdfExportOptions | Gets export options related to exporting a dashboard/dashboard item to PDF format. |
The event data class exposes the following methods:
| Method | Description |
|---|---|
| HideItem(Predicate<DashboardItem>) | Hides the dashboard item matching the specified predicate in the exported dashboard. |
| HideItem(String) | Hides the dashboard item with the specified name in the exported dashboard. |
Tip
For information on how to use the DashboardConfigurator‘s API, see the following topic: Server-Side API Overview.
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.
The code snippet below shows how to hide specific dashboard items from the exported document using the DashboardConfigurator.BeforeExportDocument event.
using DevExpress.DashboardWeb;
// ...
DashboardConfigurator.Default.BeforeExportDocument += Default_BeforeExportDocument;
// ...
private static void Default_BeforeExportDocument(object sender, 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);
}
Imports DevExpress.DashboardWeb
' ...
Private DashboardConfigurator.Default.BeforeExportDocument += Default_BeforeExportDocument
' ...
Private Shared Sub Default_BeforeExportDocument(ByVal sender As Object, ByVal e As BeforeExportDocumentWebEventArgs)
' 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(Function(TypeOf item As DashboardItem) item Is FilterElementDashboardItem)
End Sub
See Also