Back to Devexpress

ReportDesignerPreviewClientSideEventsBuilder Class

xtrareports-devexpress-dot-aspnetcore-dot-reporting-dot-reportdesigner-8d1bfd7f.md

latest6.3 KB
Original Source

ReportDesignerPreviewClientSideEventsBuilder Class

Enables you to specify handlers for the client-side events of the Web Report Designer‘s Preview.

Namespace : DevExpress.AspNetCore.Reporting.ReportDesigner

Assembly : DevExpress.AspNetCore.Reporting.v25.2.dll

NuGet Package : DevExpress.AspNetCore.Reporting

Declaration

csharp
public class ReportDesignerPreviewClientSideEventsBuilder
vb
Public Class ReportDesignerPreviewClientSideEventsBuilder

The following members return ReportDesignerPreviewClientSideEventsBuilder objects:

Show 11 links

Remarks

The ReportDesignerPreviewClientSideEventsBuilder class exposes methods whose names resemble client-side events of the Web Document Viewer that is built into the Web Report Designer. You can pass handlers for the events via the methods’ parameter. To access a ReportDesignerPreviewClientSideEventsBuilder object, use the Preview(Action<ReportDesignerPreviewClientSideEventsBuilder>) method of the ReportDesignerClientSideEventsBuilder object. The latter is available via the ReportDesignerClientSideEventsBuilder‘s Preview(Action<ReportDesignerPreviewClientSideEventsBuilder>) method.

The code below demonstrates how to handle the CustomizeElements client-side event of the Web Report Designer’s Document Viewer.

cshtml
@{
    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.CustomizeElements("previewCustomizeElements"); }); } );
}
@designer
javascript
<script type="text/javascript" id="script"> 
    function previewCustomizeElements(s, e) {
        var toolbar = e.GetById(DevExpress.Reporting.Viewer.PreviewElements.Toolbar);
        var index = e.Elements.indexOf(toolbar);
        e.Elements.splice(index, 1);
    }
</script>

Note

The name of the callback in apps based on JavaScript frameworks is the name of the correspoding client-side event with the Preview prefix. For example, in an Amgular application you should define the PreviewOnExport callback to handle the OnExport client-sude event.

Inheritance

Object ReportDesignerPreviewClientSideEventsBuilder

See Also

ReportDesignerPreviewClientSideEventsBuilder Members

DevExpress.AspNetCore.Reporting.ReportDesigner Namespace