Class SubreportObject
Represents a subreport object.
Implements
Inherited Members
Namespace: FastReport
Assembly: FastReport.Base.dll
Syntax
public class SubreportObject : ReportComponentBase, IFRSerializable
Remarks
To create a subreport in code, you should create the report page first and connect it to the subreport using the ReportPage property.
Examples
The following example shows how to create a subreport object in code.
// create the main report page
ReportPage reportPage = new ReportPage();
reportPage.Name = "Page1";
report.Pages.Add(reportPage);
// create report title band
reportPage.ReportTitle = new ReportTitleBand();
reportPage.ReportTitle.Name = "ReportTitle1";
reportPage.ReportTitle.Height = Units.Millimeters * 10;
// add subreport on it
SubreportObject subreport = new SubreportObject();
subreport.Name = "Subreport1";
subreport.Bounds = new RectangleF(0, 0, Units.Millimeters * 25, Units.Millimeters * 5);
reportPage.ReportTitle.Objects.Add(subreport);
// create subreport page
ReportPage subreportPage = new ReportPage();
subreportPage.Name = "SubreportPage1";
report.Pages.Add(subreportPage);
// connect the subreport to the subreport page
subreport.ReportPage = subreportPage;
Constructors
SubreportObject()
Initializes a new instance of the SubreportObject class with default settings.
Declaration
public SubreportObject()
Properties
PrintOnParent
Gets or sets a value indicating that subreport must print its objects on a parent band to which it belongs.
Declaration
public bool PrintOnParent { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Default behavior of the subreport is to print subreport objects they own separate bands.
ReportPage
Gets or sets a report page that contains the subreport bands and objects.
Declaration
public ReportPage ReportPage { get; set; }
Property Value
Type | Description |
---|---|
ReportPage |
Methods
Assign(Base)
Declaration
public override void Assign(Base source)
Parameters
Type | Name | Description |
---|---|---|
Base | source |
Overrides
Serialize(FRWriter)
Declaration
public override void Serialize(FRWriter writer)
Parameters
Type | Name | Description |
---|---|---|
FRWriter | writer |