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

SubreportBase Class

The base for subreport classes.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v19.1.dll

Declaration

public abstract class SubreportBase :
    XRControl,
    IXtraSupportCreateContentPropertyValue,
    IComplexControl
Public MustInherit Class SubreportBase
    Inherits XRControl
    Implements IXtraSupportCreateContentPropertyValue,
               IComplexControl

Remarks

The SubreportBase class serves as a base for the XRSubreport class. It exposes some important settings, like the SubreportBase.ReportSource property, which allows you to specify the report to be embedded as a subreport.

Examples

This example illustrates how to use the XRSubreport control at runtime.

You can also handle the XRSubreport control's XRControl.BeforePrint event and set its SubreportBase.ReportSource property to assign a report to it.

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

private void xrSubreport1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
    ((XRSubreport)sender).ReportSource = new WindowsFormsApplication1.Reports.XtraReport3();
}

The following example demonstrates how to create a XRSubreport control and assign its main properties (e.g., SubreportBase.ReportSource). This example assumes that an XtraReport object passed as a parameter to the CreateCompositeReport method, has already been created in the current project.

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

public XtraReport CreateCompositeReport(XtraReport detailReport) {
    // Create a report.
    XtraReport mainReport = new XtraReport();

    // Create a subreport.
    XRSubreport subreport = new XRSubreport();

    // Create a detail band and add it to the main report.
    DetailBand detailBand = new DetailBand();
    mainReport.Bands.Add(detailBand);

    // Set the subreport's location.
    subreport.Location = new Point(110, 100);

    // Specify a detail report as a report source for the subreport.
    subreport.ReportSource = detailReport;

    // Add the subreport to the detail band.
    detailBand.Controls.Add(subreport);

    return mainReport;
}

Implements

DevExpress.XtraReports.Serialization.IXRSerializable
DevExpress.XtraPrinting.IBrickOwner
DevExpress.Utils.Serializing.Helpers.IXtraSupportDeserializeCollectionItem
DevExpress.Utils.Serializing.IXtraSerializable
DevExpress.Utils.Serializing.Helpers.IXtraSupportCreateContentPropertyValue
DevExpress.XtraReports.Native.IComplexControl
See Also