Skip to main content
.NET 8.0+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Use the Custom WinForms Report Designer

This example demonstrates how to use the custom Report Designer form by handling the WinReportServiceController.CreateCustomDesignForm event.

In this topic, it is assumed that you have an XAF application that uses the Reports V2 Module, and you have created one or more reports (see Reports V2 Module Overview).

Create a View Controller in the WinForms application project (MySolution.Win). Override the Controller’s OnActivated method, access the WinReportServiceController using the Frame.GetController<ControllerType> method and subscribe to the WinReportServiceController.CreateCustomDesignForm event.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.ReportsV2.Win;
using DevExpress.XtraReports.UserDesigner;
// ...
public class CustomDesignerController : ViewController {
    private WinReportServiceController winReportServiceController;
    protected override void OnActivated() {
        base.OnActivated();
        winReportServiceController = Frame.GetController<WinReportServiceController>();
        if (winReportServiceController != null) {
            winReportServiceController.CreateCustomDesignForm +=
                delegate(object sender, CreateCustomDesignFormEventArgs e) {
                    e.DesignForm = new XRDesignRibbonForm();
                };
        }
    }
}

In the code above, the built-in XRDesignRibbonForm is used instead of the default XRDesignForm. You can create a custom form from scratch based on the Creating a Custom End-User Report Designer document and use it instead.