Class ReportPage
Represents a report page.
Inherited Members
Namespace: FastReport
Assembly: FastReport.OpenSource.dll
Syntax
public class ReportPage : PageBase, IFRSerializable, IParent
Remarks
To get/set a paper size and orientation, use the PaperWidth, PaperHeight and Landscape properties. Note that paper size is measured in millimeters.
Report page can contain one or several bands with report objects. Use the ReportTitle, ReportSummary, PageHeader, PageFooter, ColumnHeader, ColumnFooter, Overlay properties to get/set the page bands. The Bands property holds the list of data bands or groups. Thus you may add several databands to this property to create master-master reports, for example.
caution
Report page can contain bands only. You cannot place report objects such as TextObject on a page.
Examples
This example shows how to create a page with one ReportTitleBand and DataBand bands and add it to the report.
ReportPage page = new ReportPage();
// set the paper in millimeters
page.PaperWidth = 210;
page.PaperHeight = 297;
// create report title
page.ReportTitle = new ReportTitleBand();
page.ReportTitle.Name = "ReportTitle1";
page.ReportTitle.Height = Units.Millimeters * 10;
// create data band
DataBand data = new DataBand();
data.Name = "Data1";
data.Height = Units.Millimeters * 10;
// add data band to the page
page.Bands.Add(data);
// add page to the report
report.Pages.Add(page);
Constructors
ReportPage()
Initializes a new instance of the ReportPage class with default settings.
Declaration
public ReportPage()
Properties
BackPage
Uses this page as a back page for previously printed pages.
Declaration
public bool BackPage { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Bands
Gets the collection of data bands or group header bands.
Declaration
public BandCollection Bands { get; }
Property Value
Type | Description |
---|---|
BandCollection |
Remarks
The Bands property holds the list of data bands or group headers. Thus you may add several databands to this property to create master-master reports, for example.
Border
Gets or sets the page border that will be printed inside the page printing area.
Declaration
public Border Border { get; set; }
Property Value
Type | Description |
---|---|
Border |
BottomMargin
Gets or sets the bottom page margin, in millimeters.
Declaration
public float BottomMargin { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
ColumnFooter
Gets or sets a column footer band.
Declaration
public ColumnFooterBand ColumnFooter { get; set; }
Property Value
Type | Description |
---|---|
ColumnFooterBand |
ColumnHeader
Gets or sets a column header band.
Declaration
public ColumnHeaderBand ColumnHeader { get; set; }
Property Value
Type | Description |
---|---|
ColumnHeaderBand |
Columns
Gets the page columns settings.
Declaration
public PageColumns Columns { get; }
Property Value
Type | Description |
---|---|
PageColumns |
ExtraDesignWidth
Gets or sets a value indicating whether the page has extra width in the report designer.
Declaration
public bool ExtraDesignWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
This property may be useful if you work with such objects as Matrix and Table.
Fill
Gets or sets the page background fill.
Declaration
public FillBase Fill { get; set; }
Property Value
Type | Description |
---|---|
FillBase |
FinishPageEvent
Gets or sets a script event name that will be fired when the report engine finished this page.
Declaration
public string FinishPageEvent { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Guides
Gets or sets the page guidelines.
Declaration
public FloatCollection Guides { get; set; }
Property Value
Type | Description |
---|---|
FloatCollection |
Remarks
This property hold all vertical guidelines. The horizontal guidelines are owned by the bands (see Guides property).
HeightInPixels
Gets the current page height in pixels.
Declaration
public float HeightInPixels { get; }
Property Value
Type | Description |
---|---|
System.Single |
Landscape
Gets or sets a value indicating that page should be in landscape orientation.
Declaration
public bool Landscape { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
When you change this property, it will automatically swap paper width and height, as well as paper margins.
LeftMargin
Gets or sets the left page margin, in millimeters.
Declaration
public float LeftMargin { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
ManualBuildEvent
Gets or sets a script event name that will be fired when the report engine is about to print databands in this page.
Declaration
public string ManualBuildEvent { get; set; }
Property Value
Type | Description |
---|---|
System.String |
MirrorMargins
Gets or sets a value indicating that even pages should swap its left and right margins when previewed or printed.
Declaration
public bool MirrorMargins { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
OutlineExpression
Gets or sets an outline expression.
Declaration
public string OutlineExpression { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
For more information, see OutlineExpression property.
Overlay
Gets or sets an overlay band.
Declaration
public OverlayBand Overlay { get; set; }
Property Value
Type | Description |
---|---|
OverlayBand |
PageFooter
Gets or sets a page footer band.
Declaration
public PageFooterBand PageFooter { get; set; }
Property Value
Type | Description |
---|---|
PageFooterBand |
PageHeader
Gets or sets a page header band.
Declaration
public PageHeaderBand PageHeader { get; set; }
Property Value
Type | Description |
---|---|
PageHeaderBand |
PaperHeight
Gets or sets a height of the paper, in millimeters.
Declaration
public float PaperHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
PaperWidth
Gets or sets a width of the paper, in millimeters.
Declaration
public float PaperWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
PrintOnPreviousPage
Gets or sets a value indicating whether to start to print this page on a free space of the previous page.
Declaration
public bool PrintOnPreviousPage { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
This property can be used if you have two or more pages in the report template.
PrintOnRollPaper
Gets or sets the value indicating whether the unlimited page should be printed on roll paper.
Declaration
public bool PrintOnRollPaper { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
RawPaperSize
Gets or sets the raw index of a paper size.
Declaration
public int RawPaperSize { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
This property stores the RawKind value of a selected papersize. It is used to distiguish between several papers with the same size (for ex. "A3" and "A3 with no margins") used in some printer drivers.
It is not obligatory to set this property. FastReport will select the necessary paper using the PaperWidth and PaperHeight values.
ReportSummary
Gets or sets a report summary band.
Declaration
public ReportSummaryBand ReportSummary { get; set; }
Property Value
Type | Description |
---|---|
ReportSummaryBand |
ReportTitle
Gets or sets a report title band.
Declaration
public ReportTitleBand ReportTitle { get; set; }
Property Value
Type | Description |
---|---|
ReportTitleBand |
ResetPageNumber
Gets or sets a value indicating that FastReport engine must reset page numbers before printing this page.
Declaration
public bool ResetPageNumber { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
This property can be used if you have two or more pages in the report template.
RightMargin
Gets or sets the right page margin, in millimeters.
Declaration
public float RightMargin { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
StartOnOddPage
Gets or sets a value indicating whether this page will start on an odd page only.
Declaration
public bool StartOnOddPage { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
This property is useful to print booklet-type reports. Setting this property to true means that this page will start to print on an odd page only. If necessary, an empty page will be added to the prepared report before this page will be printed.
StartPageEvent
Gets or sets a script event name that will be fired when the report engine starts this page.
Declaration
public string StartPageEvent { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Subreport
Gets or sets the reference to a parent SubreportObject that owns this page.
Declaration
public SubreportObject Subreport { get; set; }
Property Value
Type | Description |
---|---|
SubreportObject |
Remarks
This property is null for regular report pages. See the SubreportObject for details.
TitleBeforeHeader
Gets or sets a value indicating that ReportTitle band should be printed before the PageHeader band.
Declaration
public bool TitleBeforeHeader { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
TopMargin
Gets or sets the top page margin, in millimeters.
Declaration
public float TopMargin { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
UnlimitedHeight
Gets or sets a value indicating whether the page has unlimited height.
Declaration
public bool UnlimitedHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
UnlimitedHeightValue
Get or set the current height of unlimited page.
Declaration
public float UnlimitedHeightValue { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
UnlimitedWidth
Gets or sets a value indicating whether the page has unlimited width.
Declaration
public bool UnlimitedWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
UnlimitedWidthValue
Get or set the current width of unlimited page.
Declaration
public float UnlimitedWidthValue { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Watermark
Gets or sets the page watermark.
Declaration
public Watermark Watermark { get; set; }
Property Value
Type | Description |
---|---|
Watermark |
Remarks
To enabled watermark, set its Enabled property to true.
WidthInPixels
Gets the current page width in pixels.
Declaration
public float WidthInPixels { get; }
Property Value
Type | Description |
---|---|
System.Single |
Methods
AddChild(Base)
Adds a child object to this object's childs.
Declaration
public virtual void AddChild(Base child)
Parameters
Type | Name | Description |
---|---|---|
Base | child | Object to add. |
Assign(Base)
Copies the contents of another, similar object.
Declaration
public override void Assign(Base source)
Parameters
Type | Name | Description |
---|---|---|
Base | source | Source object to copy the contents from. |
Overrides
Remarks
Call Assign to copy the properties from another object of the same type. The standard form of a call to Assign is
destination.Assign(source);
which tells the destination object to copy the contents of the source object to itself. In this method, all child objects are ignored. If you want to copy child objects, use the AssignAll(Base) method.
See Also
CanContain(Base)
Gets a value indicating that this object can contain the specified child object.
Declaration
public virtual bool CanContain(Base child)
Parameters
Type | Name | Description |
---|---|---|
Base | child | Child object. |
Returns
Type | Description |
---|---|
System.Boolean | true if this object can contain the specified child object; otherwise, false. |
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Overrides
Draw(FRPaintEventArgs)
Declaration
public override void Draw(FRPaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
FRPaintEventArgs | e |
ExtractMacros()
Used to extract macros such as "TotalPages#" in the preview mode.
Declaration
public override void ExtractMacros()
Overrides
Remarks
This method is used mainly by the TextObject to extract macros and replace it with actual values passed in the pageIndex and totalPages parameters. This method is called automatically when the object is being previewed.
GetChildObjects(ObjectCollection)
Gets a list of child objects.
Declaration
public virtual void GetChildObjects(ObjectCollection list)
Parameters
Type | Name | Description |
---|---|---|
ObjectCollection | list | List to fill with values. |
GetChildOrder(Base)
Returns z-order of the specified child object.
Declaration
public virtual int GetChildOrder(Base child)
Parameters
Type | Name | Description |
---|---|---|
Base | child | Child object. |
Returns
Type | Description |
---|---|
System.Int32 | Z-order of the specified object. |
Remarks
This method must return the index of a specified child object in the internal child list.
GetExpressions()
Gets all expressions contained in the object.
Declaration
public override string[] GetExpressions()
Returns
Type | Description |
---|---|
System.String[] | Array of expressions or null if object contains no expressions. |
Overrides
Remarks
Do not call this method directly. You may override it if you are developing a new component for FastReport.
This method is called by FastReport each time before run a report. FastReport do this to collect all expressions and compile them. For example, GetExpressions method of the TextObject class parses the text and returns all expressions found in the text.
OnFinishPage(EventArgs)
This method fires the FinishPage event and the script code connected to the FinishPageEvent.
Declaration
public void OnFinishPage(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnManualBuild(EventArgs)
This method fires the ManualBuild event and the script code connected to the ManualBuildEvent.
Declaration
public void OnManualBuild(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnStartPage(EventArgs)
This method fires the StartPage event and the script code connected to the StartPageEvent.
Declaration
public void OnStartPage(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
RemoveChild(Base)
Removes a specified object from this object's childs.
Declaration
public virtual void RemoveChild(Base child)
Parameters
Type | Name | Description |
---|---|---|
Base | child |
Serialize(FRWriter)
Serializes the object.
Declaration
public override void Serialize(FRWriter writer)
Parameters
Type | Name | Description |
---|---|---|
FRWriter | writer | Writer object. |
Overrides
Remarks
Do not call this method directly. You should override it if you are developing a new component for FastReport.
This method is called when the object needs to save the state. It may happen when:
- saving the report to the file or stream;
- saving the report to the designer's undo buffer;
- assigning the object to another object using the Assign(Base) or AssignAll(Base) methods;
- saving the object to the designer's clipboard;
- saving the object to the preview (when run a report).
SetChildOrder(Base, Int32)
Sets the z-order of the specified object.
Declaration
public virtual void SetChildOrder(Base child, int order)
Parameters
Type | Name | Description |
---|---|---|
Base | child | Child object. |
System.Int32 | order | New Z-order. |
Remarks
This method must place the specified child object at the specified position in the internal child list.
UpdateLayout(Single, Single)
Updates the children layout when the size of this object is changed by dx, dy values.
Declaration
public virtual void UpdateLayout(float dx, float dy)
Parameters
Type | Name | Description |
---|---|---|
System.Single | dx | X delta. |
System.Single | dy | Y delta. |
Remarks
This method must update positions/sizes of child objects whose Dock or Anchor properties are set to non-default values.
Events
FinishPage
This event occurs when the report engine finished this page.
Declaration
public event EventHandler FinishPage
Event Type
Type | Description |
---|---|
System.EventHandler |
ManualBuild
This event occurs when the report engine is about to print databands in this page.
Declaration
public event EventHandler ManualBuild
Event Type
Type | Description |
---|---|
System.EventHandler |
StartPage
This event occurs when the report engine starts this page.
Declaration
public event EventHandler StartPage
Event Type
Type | Description |
---|---|
System.EventHandler |