XRDesignPanel Class
A panel that is used to edit a report in the End-User Designer.
Namespace: DevExpress.XtraReports.UserDesigner
Assembly: DevExpress.XtraReports.v24.2.Extensions.dll
NuGet Package: DevExpress.Win.Reporting
Declaration
Remarks
The XRDesignPanel class represents a single Design Panel, displaying a report’s bands and controls, allowing end-users to arrange and customize them.
A Design Panel can only display a single XtraReport instance. So, an XRDesignPanel instance is used to implement an SDI (single-document interface) End-User Designer, meaning that only a single XtraReport instance can be opened in the Designer at one time. And, in order to provide an MDI (multi-document interface) End-User Designer, the XRDesignMdiController component is used, which is capable of representing multiple XRDesignPanel instances.
A Design Panel can only be used as a part of an XRDesignForm (or, XRDesignRibbonForm).
Within a Design Panel, four tabs are available: Designer, Preview, HTML View and Scripts. The currently active tab index can be accessed via the XRDesignPanel.SelectedTabIndex property.
To load a report into the XRDesignPanel, call the XRDesignPanel.OpenReport method. And, the report currently opened in the XRDesignPanel can be accessed via its XRDesignPanel.Report property. To perform any actions on the report currently being edited in the XRDesignPanel, use the XRDesignPanel.ExecCommand method.
To learn more, refer to the following documents.
Example
Use the XRDesignPanel.Report property to access the report displayed in a Report Designer form. To save that report to a file, use the XRDesignPanel.SaveReport method.
using DevExpress.XtraReports.UI;
using DevExpress.XtraReports.UserDesigner;
// ...
private void button1_Click(object sender, System.EventArgs e) {
// Create a new End-User Report Designer form.
XRDesignForm designForm = new XRDesignForm();
// Handle the DesignPanelLoaded event before opening a report in the Report Designer
designForm.DesignMdiController.DesignPanelLoaded += DesignMdiController_DesignPanelLoaded;
// Create a new blank report and show it the Report Designer dialog window.
designForm.OpenReport(new XtraReport1());
designForm.ShowDialog();
}
public XtraReport report;
void DesignMdiController_DesignPanelLoaded(object sender, DesignerLoadedEventArgs e) {
// Access the currently opened report.
report = (sender as XRDesignPanel).Report;
// Save the report that is currently open to a file.
(sender as XRDesignPanel).SaveReport(@"D:\\report.repx");
}