Skip to main content

ReportDesignerPreviewClientSideEventsBuilder.CustomizeExportOptions(String) Method

Sets the name of the JavaScript function or the entire code that will handle the CustomizeExportOptions client-side event of the Web Report Designer‘s Preview.

Namespace: DevExpress.AspNetCore.Reporting.ReportDesigner

Assembly: DevExpress.AspNetCore.Reporting.v24.1.dll

NuGet Package: DevExpress.AspNetCore.Reporting

Declaration

public ReportDesignerPreviewClientSideEventsBuilder CustomizeExportOptions(
    string callback
)

Parameters

Name Type Description
callback String

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

Returns

Type Description
ReportDesignerPreviewClientSideEventsBuilder

A ReportDesignerPreviewClientSideEventsBuilder that can be used to further configure the Report Designer Preview’s client-side events.

Remarks

The CustomizeExportOptions event allows you to customize available export formats and corresponding export options in the Document Viewer that is built into the Web Report Designer.

When implementing a handling function, use the objects passed as parameters. The first parameter passes the event sender that is the ClientReportDesigner object. The second one is an object that provides the following methods:

  • HideExportOptionsPanel - Hides the entire Export Options panel.

    function customizeExportOptions(s, e) {
        e.HideExportOptionsPanel();
    }
    
  • HideFormat - Hides the specified export format from the Export To drop-down list and the corresponding category from the Export Options panel.

    function customizeExportOptions(s, e) {
        e.HideFormat(DevExpress.Reporting.Viewer.ExportFormatID.XLS); 
    }
    
  • HideProperties - Hides the specified options for the specified export format from the Export Options panel. To remove all options for a particular export format, specify only the first method parameter.

    function customizeExportOptions(s, e) {            
        e.HideProperties(DevExpress.Reporting.Viewer.ExportFormatID.XLS, "ExportMode", "PageRange");
        e.HideProperties(DevExpress.Reporting.Viewer.ExportFormatID.XLSX);
    }
    
  • GetExportOptionsModel - Returns the export options model for the specified export format. You can then use this model to customize various export options, for instance, change a specific option’s default value.

    function customizeExportOptions(s, e) {     
        var model = e.GetExportOptionsModel(DevExpress.Reporting.Viewer.ExportFormatID.XLS);
        model.exportHyperlinks(false);
    }
    
@{
    var designer = Html.DevExpress().ReportDesigner("reportDesigner1").Height("1000px")
        .Bind(Model.Report)
        .DataSources(configureDS => { foreach (var ds in Model.DataSources) { configureDS.Add(ds.Key, ds.Value); } })
        .ClientSideEvents(configure => { configure.Preview(configure => { configure.CustomizeExportOptions("customizeExportOptions"); }); } );
}
@designer

To pass a required format to the methods listed above, use the DevExpress.Reporting.Viewer.ExportFormatID enumeration values: CSV, DOCX, HTML, Image, MHT, PDF, RTF, Text, XLS or XLSX.

See Also