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

Execute Commands in the End-User Report Designer

  • 2 minutes to read

Each user action in Report Designer corresponds to a command listed in the ReportCommand enumeration.

This example illustrates how to execute report commands in an End-User Report Designer by calling the XRDesignPanel.ExecCommand method of an active XRDesignPanel.

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

private void button1_Click(object sender, System.EventArgs e) {
    // Create a Design Tool with an assigned report instance.
    ReportDesignTool designTool = new ReportDesignTool(new XtraReport1());

    // Access the standard or ribbon-based Designer form.
    // IDesignForm designForm = designTool.DesignForm;
    IDesignForm designForm = designTool.DesignRibbonForm;

    // Create a new blank report to initialize a Design Panel.

    // Handle the Design Panel's Loaded event.
    designForm.DesignMdiController.DesignPanelLoaded += DesignMdiController_DesignPanelLoaded;

    // Load a Report Designer in a dialog window.
    // designTool.ShowDesignerDialog();

void DesignMdiController_DesignPanelLoaded(object sender, DesignerLoadedEventArgs e) {
    // Run the Report Wizard every time a Report Designer is loaded.
See Also