SubreportBase.GenerateOwnPages Property

Gets or sets whether the referenced report is printed on separate pages and uses its own page settings.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v19.2.dll

Declaration

[SRCategory(ReportStringId.CatBehavior)]
[DefaultValue(false)]
public bool GenerateOwnPages { get; set; }
<SRCategory(ReportStringId.CatBehavior)>
<DefaultValue(False)>
Public Property GenerateOwnPages As Boolean

Property Value

Type Default Description
Boolean

false

true if the referenced report is printed on separate pages and uses its own page settings; false if the referenced report uses the main report's pages and page settings.

Remarks

Set the XRSubreport's GenerateOwnPages property value to true to specify that the referenced report generates its own pages and uses its own page size, margins, and orientation.

subreport-generateownpages

This property is not in effect if you place the XRSubreport control in the main report's TopMarginBand, BottomMarginBand, PageHeaderBand, or PageFooterBand, or if you place it in a GroupHeaderBand or GroupFooterBand whose RepeatEveryPage property is set to true.

See the XRSubreport class description for more information.

Example

The code sample below adds an XRSubreport to the report and uses the ReportSourceUrl property to reference the detail report. The sample also specifies that the referenced report uses its own page settings.

TIP

Online Example: Use Subreports to Add a Chart

using System.IO;
using System.Drawing;
using DevExpress.XtraReports.UI;
using DevExpress.XtraReports.Parameters;
// ...
XRSubreport subreport = new XRSubreport() {
    BoundsF = new RectangleF(0, 100, 550, 25),
};
// "mainReport" is an XtraReport instance.
// Add a subreport to the main report's DetailBand.
mainReport.Bands["DetailBand"].Controls.Add(subreport);
// Reference a report from the report definition (REPX) file. The file is stored in the application's folder.
subreport.ReportSourceUrl = Path.Combine(Path.GetDirectoryName(typeof(ReportCreator).Assembly.Location), "DetailReport.repx");
// Specify that the referenced report uses its own page settings.
subreport.GenerateOwnPages = true;
See Also