WebDocumentViewerClientSideEventsBuilder.CustomizeExportOptions(String) Method
Sets the name of the JavaScript function or the entire code that will handle the Web Document Viewer‘s CustomizeExportOptions client-side event.
Namespace: DevExpress.AspNetCore.Reporting.WebDocumentViewer
Assembly: DevExpress.AspNetCore.Reporting.v19.2.dll
NuGet Package: DevExpress.AspNetCore.Reporting
Declaration
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 |
---|---|
WebDocumentViewerClientSideEventsBuilder | A WebDocumentViewerClientSideEventsBuilder that can be used to further configure the Document Viewer’s client-side events. |
Remarks
The CustomizeExportOptions event allows you to customize available export formats and corresponding export options in the Web Document Viewer.
When implementing a handling function, use the objects passed as parameters. The first parameter passes the event sender that is the ClientDocumentViewer 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 documentViewer = Html.DevExpress().WebDocumentViewer("webDocumentViewer1")
.Height("1000px")
.Bind(Model.Report)
.ClientSideEvents(configure => { configure.CustomizeExportOptions("customizeExportOptions"); });
}
@documentViewer
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.