Service objects
In this topic we will take a look at service objects.
"Report" Object
This object represents a link to the current report. The properties of this object can be seen when selecting the “Report” element in the “Report tree” window.
Methods:
Method
|
Description
|
function Calc
(const Expr: String): Variant
|
returns the value of “Expr”, which is an expression
for example, Report.Calc('1+2') returns “3”
any valid fastReport expression can be passed
in the parameter
|
function GetDataSet
(const Alias: String): TfrxDataSet
|
returns the dataset having the specified name
the dataset must appear in the report's dataset list
(“Report>Data...” dialogue)
|
"Engine" Object
This is the most useful and interesting object, it represents a link to the engine (FastReport’s core, which manages report construction). By using the engine’s properties and methods really exotic report design layouts can be created
The methods and properties of this object.
Property
|
Type
|
Description
|
CurColumn
|
Integer
|
the index of the current column in a multi-columned report
a value can be assigned to this property.
|
CurX
|
Extended
|
the current print position on the X-axis
a value can be assigned to this property.
|
CurY
|
Extended
|
the current print position on the Y-axis
a value can be assigned to this property.
|
DoublePass
|
Boolean
|
equals “True” if the report is a two-pass one
analogous to Report.EngineOptions.DoublePass.
|
FinalPass
|
Boolean
|
equals “True” when in last pass of a two-pass report
|
PageHeight
|
Extended
|
printable region’s height, in pixels
|
PageWidth
|
Extended
|
printable region’s width, in pixels
|
StartDate
|
TDateTime
|
time of report running
the same as the <Date> system variable
|
StartTime
|
TDateTime
|
time of report running
the same as the <Time> system variable
|
TotalPages
|
Integer
|
the number of pages in a report
the same as the < TotalPages> system variable
the report should be a two-pass one, if this variable is used
|
SecondScriptcall
|
Boolean
|
flag returning 'repeat-call' status of an event (in some cases
an event can be called repeatedly during grouping)
if True then the script has already been called
|
Methods:
Method
|
Description
|
procedure AddAnchor
(const Text: String)
|
adds “Text” to the list of anchors
see more below
|
procedure NewColumn
|
creates a new column in a multi-column report
after the last column a page break is automatically
inserted
|
procedure NewPage
|
creates a new page (page break)
|
procedure ShowBand
(Band: TfrxBand)
|
displays a band with a specified name
after displaying the band the “CurY” position is
automatically incremented
|
function FreeSpace: Extended
|
returns height of the white space left on page in pixels.
|
function GetAnchorPage
(const Text: String): Integer
|
returns the page number where the specified anchor
has been placed
|
"Outline" Object
This object represents the "Report tree" control element in a previewed report.

The “Outline” displays a tree-like structure of the finished report. When any tree node is clicked the preview pane jumps to the page displaying this node. To display the “Outline” it should be enabled either by clicking the
button in the toolbar of the preview window or by setting the “Report.PreviewOptions.OutlineVisible” property to True. The “Outline's” width in pixels can be set there as well : “Report.PreviewOptions.OutlineWidth”.
The “Outline” methods are:
Method
|
Description
|
procedure AddItem
(const Text: String)
|
adds an element having “Text” name at the current tree position
the current report page and position on the page are linked
to the element
|
procedure LevelRoot
|
moves the current position in the tree to the root level
|
procedure LevelUp
|
moves the current position in the tree up one level
|