ASPxClientCustomizeExportOptionsEventArgs Class

Allows you to customize the export panel and export options.

Declaration

declare class ASPxClientCustomizeExportOptionsEventArgs extends ASPxClientEventArgs

Remarks

ASPxClientCustomizeExportOptionsEventArgs objects are automatically created, initialized and passed to the following event handler and callback functions:

Inheritance

ASPxClientEventArgs
ASPxClientCustomizeExportOptionsEventArgs

constructor(options)

Initializes a new instance of the ASPxClientCustomizeExportOptionsEventArgs class with the specified export options.

Declaration

constructor(
    options: any
)

Parameters

Name Type Description
options any

An object that stores export options.

Methods

GetExportOptionsModel(format) Method

Returns the export options model for the specified export format.

Declaration

GetExportOptionsModel(
    format: any
): any

Parameters

Name Type Description
format any

An ExportFormatID enumeration value.

Returns

Type Description
any

An export options model.

Remarks

You can use an export options model to specify the default export options. The following code snippet, for example, specifies the ‘|” symbol as a separator for CSV data:

<script type="text/javascript">
    function onCustomizeExportOptions(s, e) {
        var model = e.GetExportOptionsModel(DevExpress.Reporting.Viewer.ExportFormatID.CSV);
        model.separator('|');
    }
</script>

<dx:ASPxWebDocumentViewer ID="ASPxWebDocumentViewer1" runat="server">
    <ClientSideEvents CustomizeExportOptions="onCustomizeExportOptions"/>
</dx:ASPxWebDocumentViewer>

To specify a document format in the method’s parameter, use the ExportFormatID enumeration value.

HideExportOptionsPanel Method

Hides the Export Options panel in the Web Document Viewer.

Declaration

HideExportOptionsPanel(): void

Remarks

The following code snippet hides the Export Options panel in the Web Document Viewer:

<script type="text/javascript">
    function onCustomizeExportOptions(s, e) {
        e.HideExportOptionsPanel();
    }
</script>

<dx:ASPxWebDocumentViewer ID="ASPxWebDocumentViewer1" runat="server">
    <ClientSideEvents CustomizeExportOptions="onCustomizeExportOptions"/>
</dx:ASPxWebDocumentViewer>

HideFormat(format) Method

Removes the specified export format from the Export To drop-down list and from the Export Options panel.

Declaration

HideFormat(
    format: any
): void

Parameters

Name Type Description
format any

An ExportFormatID enumeration value that specifies the export format to hide.

Remarks

The following code snippet removes the XLS format from the Export To drop-down list and from the Export Options panel:

<script type="text/javascript">
    function onCustomizeExportOptions(s, e) {
        e.HideFormat(DevExpress.Reporting.Viewer.ExportFormatID.XLS);
    }
</script>

<dx:ASPxWebDocumentViewer ID="ASPxWebDocumentViewer1" runat="server">
    <ClientSideEvents CustomizeExportOptions="onCustomizeExportOptions"/>
</dx:ASPxWebDocumentViewer>

HideProperties(format, properties) Method

Hides the specified options for the designated export format from the Export Options panel in the Document Viewer.

Declaration

HideProperties(
    format: any,
    ... properties: any[]
): void

Parameters

Name Type Description
format any

An ExportFormatID enumeration value that specifies the export format whose options should be hidden.

properties any[]

An array of properties to hide. If this parameter is omitted, all export options for the specified document format are hidden.

Remarks

The code snippet below hides the following export options in the Document Viewer’s Export Options panel:

  • ExportMode option for the XLS format
  • PageRange option for the XLS format
  • all options for the XLSX format.
<script type="text/javascript">
    function onCustomizeExportOptions(s, e) {
        e.HideProperties(DevExpress.Reporting.Viewer.ExportFormatID.XLS, "ExportMode", "PageRange");
        e.HideProperties(DevExpress.Reporting.Viewer.ExportFormatID.XLSX);
    }
</script>

<dx:ASPxWebDocumentViewer ID="ASPxWebDocumentViewer1" runat="server">
    <ClientSideEvents CustomizeExportOptions="onCustomizeExportOptions"/>
</dx:ASPxWebDocumentViewer>