ReportViewer.OnCustomize Property

Specifies the JavaScript function's name or the entire code which customizes the ReportViewer control.

Namespace: DevExpress.ExpressApp.ReportsV2.Mobile

Assembly: DevExpress.ExpressApp.ReportsV2.Mobile.v18.2.dll

Declaration

public string OnCustomize { get; set; }
Public Property OnCustomize As String

Property Value

Type Description
String

A string that is the JavaScript function's name or the entire code which customizes the ReportViewer control.

The event's args contains the previewModel argument that allows you to access the ReportViewer control's settings. You can use the ASPxClientSidePreviewModel class's members to customize the control. The following example demonstrates how to zoom a report preview:

using System;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.ReportsV2;
using DevExpress.ExpressApp.ReportsV2.Mobile;
// ...
public class ReportsCustomizeController : ObjectViewController<DetailView, IReportDataV2> {
    // ...
    protected override void OnActivated() {
        base.OnActivated();
        MobileReportViewerViewItem reportViewItem = 
        View.GetItems<MobileReportViewerViewItem>()[0] as MobileReportViewerViewItem;
        reportViewItem.ControlCreated += delegate (object sender, EventArgs e) {
            MobileReportViewerViewItem mobileReportViewerViewItem = (MobileReportViewerViewItem)sender;
            mobileReportViewerViewItem.ReportViewer.OnCustomize = 
                @"function(args) { args.previewModel.reportPreview.zoom(0.7); }";
        };
    }
}
Note

Only use this property or BeforeInitialize.

See Also