The requested page is not available for the requested platform. You are viewing the content for Default platform.

XtraReport() Constructor

Initializes a new instance of the XtraReport class with the default settings.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v18.2.dll

Declaration

public XtraReport()
Public Sub New

Examples

The following code illustrates how to create a simple "Hello, World!" report at runtime by creating a new class inherited from the XtraReport class.

Before running this code, add all required assemblies to the References list of your project. The required assemblies may be different, depending on your application's target platform. To learn more, see Application Deployment.

The report in this sample contains an XRLabel (named HelloWorldLabel), which is placed onto a Detail band. The PageHeader and PageFooter bands do not contain any controls and are added to the report only for illustration.

using System.Drawing;
using DevExpress.XtraReports.UI;

namespace MyReportsNamespace {

    public class MyReport : XtraReport {

        private DetailBand Detail;
        private PageHeaderBand PageHeader;
        private PageFooterBand PageFooter;
        private XRLabel HelloWorldLabel;

        public MyReport() {
            this.Detail = new DetailBand();
            this.PageHeader = new PageHeaderBand();
            this.PageFooter = new PageFooterBand();
            this.PageFooter.Height = 30;
            this.PageHeader.Height = 30;

            this.Bands.AddRange(new Band[] { this.Detail, this.PageHeader, this.PageFooter });

            this.HelloWorldLabel = new XRLabel();
            this.HelloWorldLabel.Text = "Hello, World!";
            this.HelloWorldLabel.Font = new Font("Tahoma", 15, FontStyle.Bold);

            this.Detail.Controls.Add(this.HelloWorldLabel);
        }
    }
}
See Also