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.v24.1.dll
NuGet Package: DevExpress.Reporting.Core
Declaration
[DefaultValue(false)]
[SRCategory(ReportStringId.CatBehavior)]
public bool GenerateOwnPages { get; set; }
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 GenerateOwnPages
property of the XRSubreport control to true
to specify that the report referenced in the subreport control generates its own pages and has its own page size, margins, and orientation.
The GenerateOwnPages
property is not in effect if you place the XRSubreport control in the following bands:
- TopMarginBand
- BottomMarginBand
- PageHeaderBand
- PageFooterBand
- GroupHeaderBand with RepeatEveryPage property set to ‘true’
- GroupFooterBand with RepeatEveryPage property set to ‘true’
Tips and Limitations
If you enable the GenerateOwnPages
option, the main report’s page footer will not be displayed on the subreport pages. To continue page numbering on subreport pages, add the PageFooterBand to the subreport and place the XRPageInfo control onto that band.
Example
The following code snippet adds an XRSubreport to the report and uses the ReportSourceUrl property to reference the detail report. The code also sets the GenerateOwnPages
property value to true
to specify that the referenced report uses its own page settings.
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 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;