DxReportDesignerCallbacks.PreviewCustomizeExportOptions Property
Specifies the JavaScript function that handles the Web Report Designer’s PreviewCustomizeExportOptions client-side event.
Namespace: DevExpress.Blazor.Reporting
Assembly: DevExpress.Blazor.Reporting.v24.2.JSBasedControls.Common.dll
NuGet Package: DevExpress.Blazor.Reporting.JSBasedControls.Common
Declaration
Property Value
Type | Description |
---|---|
String | The name of a JavaScript function used to handle the PreviewCustomizeExportOptions event. |
Remarks
The CustomizeExportOptions event allows you to hide export formats and specify the default export options in the Report Designer Preview. The Report Designer Preview is the Document Viewer control built into the End-User Report Designer.
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 the 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 sample 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 XLS format;
- removes the RTF section from the Options tab;
- specifies “false” as the ExportHyperlinks option’s default value for XLS export.
window.ReportingDesignerCustomization = {
onPreviewCustomizeExportOptions: function (s, e) {
// Remove CSV export.
e.HideFormat(s.dx.Reporting.Viewer.ExportFormatID.CSV);
// Remove Text export
e.HideFormat({ format: s.dx.Reporting.Viewer.ExportFormatID.TXT, propertyName: "textExportOptions" });
// Do not show the ExportMode and PageRange property editors in the XLSX Export Options section.
e.HideProperties(s.dx.Reporting.Viewer.ExportFormatID.XLSX, "ExportMode", "PageRange");
// Hide the RTF Export Options section.
e.HideProperties(s.dx.Reporting.Viewer.ExportFormatID.RTF)
// Clear the Export Hyperlinks checkbox in the XLS Export Options section.
var model = e.GetExportOptionsModel(s.dx.Reporting.Viewer.ExportFormatID.XLS);
model.exportHyperlinks(false)
}
}