The requested page is not available for the requested platform. You are viewing the content for Default platform.

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.v19.1.dll

Declaration

public ReportDesignerPreviewClientSideEventsBuilder CustomizeExportOptions(
    string callback
)
Public Function CustomizeExportOptions(
    callback As String
) As ReportDesignerPreviewClientSideEventsBuilder

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.Report.Preview.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.Report.Preview.ExportFormatID.XLS, "ExportMode", "PageRange");
        e.HideProperties(DevExpress.Report.Preview.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.Report.Preview.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.Report.Preview.ExportFormatID enumeration values: CSV, DOCX, HTML, Image, MHT, PDF, RTF, Text, XLS or XLSX.

See Also