ASPxDashboard.CustomizeExportDocument Event

Allows you to customize the exported document.

Namespace: DevExpress.DashboardWeb

Assembly: DevExpress.Dashboard.v21.1.Web.WebForms.dll

Declaration

public event CustomizeExportDocumentWebEventHandler CustomizeExportDocument

Event Data

The CustomizeExportDocument event's data class is CustomizeExportDocumentWebEventArgs. The following properties provide information specific to this event:

Property Description
DashboardId Gets the identifier of the exported dashboard. Inherited from CustomExportBaseWebEventArgs.
ExcelExportOptions Gets options related to exporting a dashboard/dashboard item to Excel format.
ExcelOptions Obsolete. Gets options related to exporting a dashboard item to Excel format.
ExportAction Gets the export action performed by an end-user. Inherited from CustomExportBaseWebEventArgs.
ExportMode Gets the document export mode. Inherited from CustomExportBaseWebEventArgs.
ImageExportOptions Gets export options related to exporting a dashboard/dashboard item as an image. Inherited from CustomExportBaseWebEventArgs.
ImageOptions Obsolete. Gets export options related to exporting a dashboard/dashboard item as an image. Inherited from CustomExportBaseWebEventArgs.
ItemComponentName Gets the component name of the exported dashboard item. Inherited from CustomExportBaseWebEventArgs.
PdfExportOptions Gets export options related to exporting a dashboard/dashboard item to PDF format. Inherited from CustomExportBaseWebEventArgs.
PdfOptions Obsolete. Gets export options related to exporting a dashboard/dashboard item to PDF format. Inherited from CustomExportBaseWebEventArgs.
Stream Gets or sets a stream containing the exported document.

Remarks

CustomizeExportDocument is raised after the ASPxDashboard.CustomExport and allows you to customize the stream containing the resulting document (such as PDF, Image or Excel). Use the CustomizeExportDocumentWebEventArgs.Stream event parameter to access the stream.

Example

The ASPxDashboard.CustomizeExportDocument event allows you to obtain the stream of the exported document using the CustomizeExportDocumentEventArgs.Stream property and customize the document’s layout according to your requirements. For instance, Excel documents can be loaded into the Workbook component for further processing.

This example shows how to add a custom header to each sheet for the exported workbook.

View Example

<%@ Page Language="vb" AutoEventWireup="true" CodeBehind="WebDashboardForm.aspx.vb" Inherits="WebDashboard_CustomizeExport.WebDashboardForm" %>
<%@ Register assembly="DevExpress.Dashboard.v17.1.Web, Version=17.1.2.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" 
    namespace="DevExpress.DashboardWeb" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v17.1, Version=17.1.2.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" 
    namespace="DevExpress.Web" tagprefix="dx" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body >
    <form id="form1" runat="server">
    <div style="position:absolute; left:0; right:0; top:0; bottom:0;">
        <dx:ASPxDashboard ID="ASPxDashboard1" runat="server" 
            AllowExportDashboardItems="True" Height="100%" Width="100%" WorkingMode="ViewerOnly"
            OnCustomizeExportDocument="ASPxWebDashboard1_CustomizeExportDocument" 
            OnConfigureDataConnection="ASPxDashboard1_ConfigureDataConnection">
        </dx:ASPxDashboard>
    </div>
    </form>
</body>
</html>
See Also