Skip to main content
A newer version of this page is available. .

PreviewReportCustomizationService.CustomizeReport(XtraReport) Method

Enables you to customize the current report when the Report Designer is about to be switched to the Preview tab.

Namespace: DevExpress.XtraReports.Web.ReportDesigner.Services

Assembly: DevExpress.XtraReports.v19.1.Web.dll

NuGet Package: DevExpress.Web.Reporting.Common

Declaration

public virtual void CustomizeReport(
    XtraReport report
)

Parameters

Name Type Description
report XtraReport

The current report to be previewed.

Remarks

The CustomizeReport method allows you to change the report’s settings when it is about to be previewed. These changes are in effect only in the Preview tab.

The following example demonstrates how to change the report’s orientation.

using DevExpress.XtraReports.UI;
using DevExpress.XtraReports.Web;
using DevExpress.XtraReports.Web.ReportDesigner.Services;

public class MyPreviewReportCustomizationService: PreviewReportCustomizationService {
    public override void CustomizeReport(XtraReport report) {
        report.Landscape = true;
    }
}

Then, register your custom service implementation at the application’s startup.

  • ASP.NET WebForms and ASP.NET MVC

    using DevExpress.XtraReports.Web.ReportDesigner;
    using DevExpress.XtraReports.Web.ReportDesigner.Services;
    
    void Application_Start(object sender, EventArgs e) {
        DefaultReportDesignerContainer.Register<PreviewReportCustomizationService, MyPreviewReportCustomizationService>();
    }
    
  • ASP.NET Core

    using DevExpress.XtraReports.Web.ReportDesigner.Services;
    
    public void ConfigureServices(IServiceCollection services) {
        // ...
        services.AddSingleton<PreviewReportCustomizationService, MyPreviewReportCustomizationService>();
    }
    
See Also