Skip to main content

Create a Custom End-User Report Designer

  • 3 minutes to read

Note

You need a DevExpress WinForms subscription to use the API described in this tutorial.

The Invoke a Default End-User Report Designer Form tutorial illustrates how to open the Report Designer if you have an active license for the DevExpress Reporting Subscription.

This tutorial demonstrates how to add the End-User Report Designer to WinForms applications.

Note

If your WinForms application targets .NET Core/.NET5+, add the DevExpress.Win.Design NuGet package to this application to use the End-User Report Designer.

Create a Ribbon Report Designer

Switch to the application’s main form in Visual Studio and press CTRL+ALT+X to open the Toolbox. Drop the RibbonReportDesigner component onto the form to create a custom End-User Report Designer with a ribbon UI.

If required, you can hold down the ALT key while dropping this component to add the End-User Report Designer with the previous ribbon version.

drop-ribbon-report-designer

Use the XRDesignMdiController.OpenReport method to open a report in the End-User Report Designer.

private void Form1_Load(object sender, System.EventArgs e) {
    XtraReport1 report = new XtraReport1();
    reportDesigner1.OpenReport(report);
}

Tip

Refer to the Create a Report in Visual Studio article for information on adding a new report to the Visual Studio project.

Create a Standard Report Designer

Switch to the application’s main form in Visual Studio and press CTRL+ALT+X to open the Toolbox. Drop the StandardReportDesigner component onto the form to create a custom End-User Report Designer with a standard UI.

drop-standard-report-designer

Use the XRDesignMdiController.OpenReport method to open a report in the End-User Report Designer.

private void Form1_Load(object sender, System.EventArgs e) {
    XtraReport1 report = new XtraReport1();
    reportDesigner1.OpenReport(report);
}

Visually Inherit from a Designer Form

Another way to create an End-User Report Designer form is to visually inherit it from the XRDesignForm class.

Note

This approach imposes limitations on using the Visual Studio design time - you cannot customize the XRDesignBarManager at design time.

Do the following to create an inherited End-User Report Designer form:

  1. Select PROJECT | Add New Item… in the Visual Studio’s main menu and select Inherited Form in the dialog that is invoked.

    end-user-designer-inherit-design-form

  2. Click Browse in the invoked Inheritance Picker dialog, and locate the DevExpress.XtraReports.v21.2.Extensions.dll file (it is stored in the “C:\Program Files (x86)\DevExpress 21.2\Components\Bin\Framework” folder by default).

    Select the XRDesignForm or XRDesignRibbonForm class as the base for the created form and click OK.

    end-user-designer-inheritance-picker

This adds a custom Report Designer form to your application:

You can now customize the Report Designer form by adding custom code to the created subclass:

using DevExpress.XtraReports.UserDesigner;
// ...

namespace WindowsFormsApplication1 {
    public partial class CustomForm : XRDesignForm {
        public CustomForm() {
            InitializeComponent();
        }
            // ...
    }
}

Change the Default Report Settings

The StandardReportDesigner and RibbonReportDesigner components use the following default settings to create new reports:

Use the DefaultReportSettings property to change the default report settings.

See Also