Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxDocumentViewerCallbacks.CustomizeExportOptions Property

Specifies the handler for the CustomizeExportOptions client-side event that allows you hide export formats and specify the default export options.

Namespace: DevExpress.Blazor.Reporting

Assembly: DevExpress.Blazor.Reporting.v24.2.JSBasedControls.Common.dll

NuGet Package: DevExpress.Blazor.Reporting.JSBasedControls.Common

#Declaration

[Parameter]
public string CustomizeExportOptions { get; set; }

#Property Value

Type Description
String

The name of a JavaScript function used to handle the CustomizeExportOptions event.

#Remarks

The CustomizeExportOptions event allows you to hide export formats and specify the default export options in the Web Document Viewer.

The handler function receives two parameters - the first parameter is the client-side Document Viewer (the event sender) that exposes the dx property to access the client-side DevExpress objects. The second parameter is an object with the following properties and methods:

  • HideExportOptionsPanel method
    Hides the Export Options panel.

  • HideFormat method
    Hides the specified export format from the Export To drop-down list and also hides its related category from the Export Options panel.

  • HideProperties method
    Hides the specified options for the export format in the Export Options panel. To remove all options for a particular export format, specify only the first method parameter.

  • GetExportOptionsModel method
    Returns the export options model for the specified export format. Use this model to change the option’s default value.

The code snippet below does the following:

  • removes the CSV format from the list of available export formats and from the Options tab;
  • removes the TXT format from the list of available export formats and from the Options tab;
  • hides the “ExportMode” and “PageRange” options for the XLSX format;
  • removes the RTF section from the Options tab;
  • specifies “false” as the ExportHyperlinks option’s default value for XLS export.
window.ReportingViewerCustomization = {
    onCustomizeExportOptions: function (s, e) {
        // Remove CSV export.
        e.HideFormat(DevExpress.Reporting.Viewer.ExportFormatID.CSV);
        // Remove Text export
        e.HideFormat({ format: DevExpress.Reporting.Viewer.ExportFormatID.TXT, propertyName: "textExportOptions" });
        // Do not show the ExportMode and PageRange property editors in the XLSX Export Options section. 
        e.HideProperties(DevExpress.Reporting.Viewer.ExportFormatID.XLSX, "ExportMode", "PageRange");
        // Hide the RTF Export Options section.
        e.HideProperties(DevExpress.Reporting.Viewer.ExportFormatID.RTF)
        // Clear the Export Hyperlinks checkbox in the XLS Export Options section.
        var model = e.GetExportOptionsModel(DevExpress.Reporting.Viewer.ExportFormatID.XLS);
        model.exportHyperlinks = false
    }
}
See Also