FastReport Online Designer
User Manual
Version 2024.1© 2008-2024 Fast Reports Inc.

https://www.fast-report.com

1 / 176

Introduction
FastReport Online Designer is a web version of the desktop FastReport.Net designer. Online report designer is a
RIA (Rich Internet application) application that allows you to run it on any device that has a modern Internet
browser. Online designer will work in recent versions of popular browsers (Chrome, Firefox, Opera, Safari, IE). But,
despite all these cross-platform advantages, the online version is inferior to desktop version in terms of
convenience and functionality.
Thus, FastReport Online Designer positioned as an editor of .Net reports that have already been created and placedon any UUID on the server. Online designer communicates with the server through a specified pre-API, which
includes 3 requests:
getReport - is used for initialization. Gets the report template and sends it to the online designer that
prepares a report for editing in the browser.
previewReport (preview mode) - edited report template is sent to the server, which builds the report andreturns it in html format. The report runs on the server via FastReport.Net.
saveReport - saves the report template to the server.
For each query you should pass the UUID of the report to the server using a parameter to identify the report on theserver.

The product is developed with the latest capabilities of modern browsers. For example, thanks to HTML5, once
downloading the online designer, you can use it when not connected to the network.
FastReport Designer Online has a monolithic kernel, enabling the connection of modules, which are components
of/bands/dialog components and some other parts of the system. To identify these modules and theirdependencies the technology RequireJS is used. Such modularity allows you to build a product for the needs of theclient with the necessary components, which reduces the size of the project (since this is a web app, the size is very
important and the smaller, the better). For individual assemblies the online designer provides the designerconstructor.

https://www.fast-report.com

2 / 176

It is worth mentioning other technologies used in FastReport Online Designer. Traditionally used jQuery, and theclient’s template engine uses jsrender and RequireJS. Script code editor uses CodeMirror, that can be embedded in
the report.
The current version of FastReport Online Designer is missing a RFID Label component. Also not all components areavailable in dialogue forms. Only present: Button, CheckBox, CheckedListBox, ComboBox, DateTimePicker, Label,
ListBox, MonthCalendar, RadioButton, TextObject.

https://www.fast-report.com

3 / 176

Working principle

The Online Designer can be used together FastReport.Net WebReport objects in editions FastReport .Net
Win+Web, Professional, Enterprise.
On-line Designer can change the script of the report and event handlers of the report, but by default for security
reasons this option is disabled. This feature can be enabled in the properties of the object WebReport. When thisoption is disabled the script contents after design will be ignored and replaced with the original text. Also, forsecurity purposes we do not send in Designer built-in connection strings.
WebReport object loads in ASP.NET page.
WebReport sends an AJAX request to the handler of FastReport to get of on-line Designers container iniframe context (The code of the Report Designer is placed in a separate folder on the application site).
When On-line Designer is loaded in browser it sends AJAX query to the handler to get a report template(getReportByUUIDFrom).
The server application prepares and sends a report template to the On-line Designer.
The Designer can request a preview of the current report. It sends request to the handler in server(makePreviewByUUID). The server application runs a received report and sends back result in html. The
Designer shows it in preview window. This preview can be printed or exported in several formats.
The Designer can save a report in server through AJAX query (saveReportByUUIDTo) with report contents.
The server application prepares received data and sends request to call-back page in application.
Object WebReport exists in the server cache for a limited time, and then deleted from memory. Time of keeping an
object in memory is determined in minutes in property WebReport.CacheDelay (by default: 60).

https://www.fast-report.com

4 / 176

Setting up the designer
Step-by-step manual for set-up the Online Designer:
1. First let’s copy a folder with Online Designer (by default: WebReportDesigner) from installation path to the
web applications root.
2. Then check the file web.config for handler settings that needed for WebReport functionality:
for IIS6:<system.web>…
<addpath="FastReport.Export.axd" verb="*" type="FastReport.Web.Handlers.WebExport"/></system.web>
for IIS7:<system.webServer><addname="FastReportHandler" path="FastReport.Export.axd" verb="*"type="FastReport.Web.Handlers.WebExport"/></system.webServer>

3. Then check the settings of the Report Designer in the file WebReportDesigner/scripts/config-data.js:'getReportByUUIDFrom': '/FastReport.Export.axd?getReport=','saveReportByUUIDTo': '/FastReport.Export.axd?putReport=','makePreviewByUUID': '/FastReport.Export.axd?makePreview=',

These parameters should contain the path to the handler FastReport relative to the root of web site. If your path isdifferent from what is written, it must be corrected, for example:'getReportByUUIDFrom': '/oursite/FastReport.Export.axd?getReport=',

4. When WebReport is used in ASPX markup, you need drag-n-drop the object on a page and set the properties.
For MVC you need write the code in the controller:
4.1. Enable editing of reports:

webReport.DesignReport = true;

https://www.fast-report.com

5 / 176

4.2. Set the unique object name for WebReport, necessary for further identification in the call-back page while
maintaining the edited report:

webReport.ID = "MyDesignReport1";

4.3. Prohibit report's script editing in the On-line Designer (if you want to allow editing - set to true):

webReport.DesignScriptCode = false;

4.4. Specify the path to the main file of the report designer, the folder with the designer should be copied to theappropriate place of web-application:

webReport.DesignerPath = "~/WebReportDesigner/index.html";

4.5. Set the path to the call-back page on the site, the call to be executed after the report is saved to a temporary
folder. Example for MVC path to View (you have to create new blank View specially for call-back in controller withsame name):

webReport.DesignerSaveCallBack = "~/Home/SaveDesignedReport";

or, for ASPX:

webReport.DesignerSaveCallBack = "~/DesignerCallBack.aspx";

The following parameters sent in the GET request:

reportID="here is webReport.ID"&reportUUID="here is saved report file name"In this context reportID corresponds to the object WebReport.ID, and reportUUID is the file name that is stored in a
temporary folder. The developer shall perform further actions to save the report to the source file on the disk,
database or cloud storage. Temporary file named reportUUID must be removed from the temporary folder aftersaving. You can use POST query for call-back transfer of report file, read more below in section 4.6. Sample codecall-back pages will be shown below.
4.6. Set the path to the temporary folder in which to save the edited reports before calling the call-back. You haveto set write permissions to this folder:

webReport.DesignerSavePath = "~/App_Data/DesignedReports";

You can set the property webReport.DesignerSavePath to blank string to activate POST mode.
4.7. Set the lifetime of WebReport object in servers cache in minutes, the default is 60:

webReport.CacheDelay = 120;https://www.fast-report.com

6 / 176

5. Create a call-back page to save the edited reports.
5.1. If you are using ASPX layout, you need to add the following code in the Page_Load event handler:
protected void Page_Load(object sender, EventArgs e){
string reportID = Request.QueryString["reportID"];
string reportUUID = Request.QueryString["reportUUID"];// 1. ReportID value identifies the object that caused the designer. The value corresponds to the property
webReport.ID, which was filled by a call of the designer.
// 2. Combining the path that we have filled in the property webReport.DesignerSavePath, and the resulting
reportUUID, we get the path to the temporary file with edited report.
// 3. This file can be opened and resaved in the appropriate place (another file, cloud, a database, etc).
// 4. The temporary file must be deleted after saving.
}
5.2. In MVC markup you need to create a method in the controller and an empty View. The code in the controller:
public ActionResult SaveDesignedReport(string reportID, string reportUUID){// 1. ReportID value identifies the object that caused the designer. The value corresponds to the property
webReport.ID, which was filled by a call of the designer.
// 2. Combining the path that we have filled in the property webReport.DesignerSavePath, and the resulting
reportUUID, we get the path to the temporary file with edited report.
// 3. This file can be opened and resaved in the appropriate place (another file, cloud, a database, etc).
// 4. The temporary file must be deleted after saving.
return View();}
To work with POST transfer you need to add the following line before controller:[HttpPost]
public ActionResult SaveDesignedReport(string reportID, string reportUUID)
5.3. You can use any localizations for Online Designer:

webReport.DesignerLocale = "en";("en" can be changed to any other supported language, full list of supported languages is similar to files in folder"locales" in the Designer distribution package).
When creating handlers in the Call-back page, pay an attention to filtering and checking of parameters in thehttps://www.fast-report.com

7 / 176Get/POST requests. Be sure to check them for null values.
The best place for object with On-line Designer is at the bottom of the page. The recommended width is 100% or atleast 930px. Recommended height of the object is at least 600px.

https://www.fast-report.com

8 / 176

Designer
Let’s consider the structure of the interface of FastReport Online Designer. There are the following areas:menu;
report page;"Properties" window;"Events" window;
report tree;"Data" window;
toolbar;pages tabs;
report script.

Let us examine each item.
Main menu is placed at the top of the report designer: Main, Report, View, Components, Bands. When we select themenu item, we open the tab with toolbars, similar to Microsoft Office 2007.
The toolbar of the Main tab is used to change the appearance of the report components.
On the "Report" tab you can save the report, add/delete page, add dialog, and run the report in preview mode.
On the tab “View”, you can specify settings for the grid of a report page. The grid helps to position components inaccordance with each other.
The “Components” tab contains the FastReport component palette. Components allow you to display different datain the bands. They are an integral part of the report template along with the bands.
The tab "Bands" contains a palette of bands that can be added to the report. The bands represent a container for

https://www.fast-report.com

9 / 176

placing components. The type of band determines its location in the report.
Report page contains the bands and components that make up a report template.
The Properties window is hidden by default, like the other windows. It can be enabled by using the icon on the
sidebar. So you can include the "opening Event", the tree report and the "Data" window. For convenience the open
windows can be moved anywhere on the screen. To return the window to its original position click on the pin iconin the header.
The “Properties” window displays the properties of the selected report object (such as band, component, or a reportpage).
The "Events" shows the events available for the selected report object.
The report tree contains all report objects in a hierarchical list. By the right-click on items in the list you can call thecontext menu for the selected object.
At the bottom of the report designer you can see the tabs that represents report pages, as well as the icon of thereport script. If you use the script, the code editor opens instead of the report page:The report script allows the user to define the logic of the report.

https://www.fast-report.com

10 / 176

Report pages
Template consists of one (mostly) or several report pages. Report page, in turn, contains bands. Report objects like
Text, Picture and others are placed on the band:

Report template can consist of several pages. For example, you can create a template containing title-page and apage with data. When creating such a report, the first page will be printed first, then the second page and so on.
Every page of template can generate one or several pages of a prepared report – this depends on the data it
contains:

Report pages are also used when working with subreports. Contrary to other report generators, subreports in
FastReport are saved in a separate template page, and not in a separate file.
A new report already contains one page, but if you want to add another one, go to the "Report" tab and click on"New Report Page" button.

Also, here you can add a dialog form (New Dialog).
To delete a report page, you need to select the desired page and click on the "Delete page" button. If the reporthttps://www.fast-report.com

11 / 176

consists of one page the delete button will be inactive.
You can set the page size on the Home tab, in the section "Extra".

Other properties of the page can be seen in the window "Properties". You need to select the page using the tabs atthe bottom of the designer window.

You can set the page size and margins in the "Paper" section. Section "Print" allows you to determine two-sided
printing, the source of the first page and the source of other pages. In addition, you have access to the pageappearance properties such as border, fill, etc.

https://www.fast-report.com

12 / 176

BandsThe band is an object which is located directly on the report page and is a container for other objects like "Text","Picture" and others.
In all, in FastReport there are 13 types of bands. Depending on its type, the band is printed in a certain place in thereport.
Band

How it's printed

ReportTitle

It is printed once at the very beginning of the report. You can choose the order of printing - before the "Page
Header" band or after it - with the help of the "TitleBeforeHeader" page property. Changing this property canbe done with the help of "Properties" window. By default, property is equal to true, that is, report title isprinted before page header.

ReportSummary

It is printed once at the end of the report, after the last data row, but before the "Page Footer" band.

Page
Header

It is printed on top of every page of the report.

Page
Footer

It is printed at the bottom of every page of the report.

ColumnHeaderThis band is used when printing a multi-columned report (when the number of columns indicated in the page
setup > 1). It is printed on top of every column after the Page Header band.

ColumnFooterPrinted at the bottom of every column, before the Page Footer band.

Data

This band is connected to the data source and is printed as many times as there are rows in the source.

Data
HeaderThis band is connected to the "Data" band and is printed before the first data row.

Data
FooterThis band is connected to the "Data" band and is printed after the last data row.

Group
Header

It is printed at the beginning of every group, when the value of the group condition changes.

Group
Footer

It is printed at the end of every group.

Child

This band can be connected to any band, including another child band. It is printed immediately after its
parent.

Overlay

Printed as a background on every report page.

Consider the display of bands in the designer.
On the left side of the report page are the headers of the bands. By default, a new report contains 4 bands:

https://www.fast-report.com

13 / 176

ReportTitle;
PageHeader;
Data;
PageFooter.

Bands can have a fill and border (disabled by default). Also, bands have a grid displayed in design-time for easy
positioning of components. The grid can be set in "View" menu of the main menu.

To change the size of the band you can use the mouse. Move the cursor to the bottom of the band. The cursor
changes. Click the left mouse button and adjust the height of the band by moving the mouse up or down.

https://www.fast-report.com

14 / 176

Band settings
To add a band to the report page, click the tab "Bands". Select the required band and click on it.
To add the "Data Header" or "Data Footer" you should pre-select the Data band on the report page.
To add another band "Data" you can choose any of the bands on the report page except the already existing band
"Data". Then add the band "Data" by using the icon on the toolbar. If you select Data band on the report page andadd another Data band, the detailed "Data" band will be added. There is another way to add a detailed band "Data".
Call the context menu for the "Data" band by the right mouse click. Then click the "Add Detail Data Band" menu
item. In addition, from this menu you can add a child band.

You can delete the selected band by using a context menu or pressing the Delete key. FastReport will limit youractions which could lead to the creation of an incorrect report template. For example, if you have a band “Group
Header”, you can't delete the "Data" band from this group. First you have to remove the group. Also, when you
delete some of the bands, they will be deleted along with their associated bands. For example, if you delete the"Data" band its header, footer, child band and detail band will be removed too.

https://www.fast-report.com

15 / 176

Print orderSo, there are several bands on the page. Look at how FastReport will create a report:

The order of the bands is as follows:
report title;
page header;data. Will be printed as many times as there are rows in the data source that is connected to the band;
page footer.
The finished report will look like this:https://www.fast-report.com

16 / 176

In the process of printing, FastReport checks if there is enough space on the current page of the prepared report, sothat the band can be printed. If there isn’t enough space, the following occurs:
page footer is printed;
a new page is added;
page header is printed;
continues to print the band which did not fit on the previous page.

https://www.fast-report.com

17 / 176

Band properties
Every band has several useful properties, which affect the printing process. To view the properties of the band, youneed to select it with the mouse on the report page, and open the Properties window with the icon on the sidebar.
Property

Description

CanGrow, CanShrink

These properties determine whether a band can grow or shrink depending on the size of theobjects contained in the band. If both properties are disabled, the band will always have the size
specified in the designer.

CanBreakIf the property is enabled, FastReport tries to print a part of the band’s contents on the available
space, that is, "break" the band.

StartNewPage

Printing a band with such property begins on a new page. This property is usually used whenprinting groups; that is, every group is printed on a new page.

PrintOnBottom

A band with this property is printed at the bottom of the page, before the "Page Footer" band
.This can be useful when printing certain documents, where the total sum is supposed to beprinted at the bottom of the page.

RepeatOnEveryPage

The bands - "Data Header", "Data Footer", "Group Header" and "Group Footer" - have got thisproperty. This type of band will be printed on each new page, when data printing is being done.

https://www.fast-report.com

18 / 176

Components
Text
The "Text" object is the basis of a data presentation in FastReport. In the components palette, it looks like:And on the report page:

Object “Text” allows to display the following text information:lines of text;
expressions;
report parameters;
totals;fields from data sources;
system variables.
Furthermore, you can combine these data in a text object.
To open the editor of the text object, you need to double-click on the object. This opens the "Expression editor":

The "Text" object can contain a plain text mixed with expressions. For example:

Today is [Date]

When printing such an object, all expressions contained in the text will be calculated. So the result may look likethis:Today is 12.09.2010https://www.fast-report.com

19 / 176

As seen, expressions are identified by square brackets. This is set in the "Brackets" property, which by default
contains the string "[,]".When needed, you can use a different set of symbols, for example "<,>", or "<!,!>". In thelast case, an expression in the text will be like this:Today is <!Date!>

Apart from this, it is possible to disable all expressions. To do this, set the AllowExpressions property to false. In thiscase the text will be shown "as is".
Inside the square brackets, you can use any valid expression. Read more about expressions in the "Expressions"chapter. For example, an object with the following text:

2 * 2 = [2 * 2]will be printed like this:2 * 2 = 4

Frequent mistake - attempt to write an expression outside the square brackets. Reminding, that it is considered an
expression and gets executed only that, which is located inside square brackets. For example:

2 * 2 = [2] * [2]This text will be printed this way:

2 * 2 = 2 * 2

There may be elements inside an expression that needs own square brackets. For example, it may be a reference toa system variable. Let's look at the following example:

The next page: [[Page] + 1]

The text contains an expression [Page] + 1. Page is a system variable which returns the number of the current
report page. It is included in own brackets. These brackets must be square brackets, regardless of the "Text" object
settings.
Strict speaking, we were supposed to use two pairs of square brackets when using the "Date" system variable in theexamples above:

Today is [[Date]]

However FastReport allows to leave out unnecessary pair of brackets if there is only one member in an expression.

https://www.fast-report.com

20 / 176

You can print the data column in the following way:

[Datasourcename.Column name]

As you can see, the square brackets are used here. The data source name and data column name are separated by
the period. For example:[Employees.FirstName]

Read more about using the data columns in the "Expressions" chapter.
There are several ways to insert a data column into the "Text" object.
1. In the "Text" object's editor we write the name of the data column manually. This method is the mostinconvenient as it is easy to make a mistake.
2. In the object's editor we choose the needed data column and drag&drop it into the text:

3. Drag&drop a data column from the "Data" window into the report page. In this case the "Text" object iscreated which contains a link to the column.

https://www.fast-report.com

21 / 176

You may use some simple HTML tags in the "Text" object. By default, tags are disabled; to enable it, go "Properties"
window and set the "HtmlTags" property to true. Here is a list of supported tags:
Tag

Description<b>...</b>

Bold text.

<i>...</i>

Italic text.

<u>...</u>

Underlined text.

<strike>...
</strike>

Strikeout text.

<sub>...</sub>

Subscript.

<sup>...</sup>Superscript.

<font color=...>...
</font>Font color. The color may be either the named color (such as DarkGray), or a hexadecimal code in the#RGB format, for example #FF8030.

The following examples demonstrate how these tags can be used.

text <b>bold text</b> <i>text in italic</i> <b><i>bold and in italic</b></i>
E = mc<sup>2</sup>A<sub>1</sub> = B<sup>2</sup>this is regular text, <font color=red>and this is a red one</font>this is regular text, <font color=#FF8030>and this is an orange one</font>This text will be displayed in the following way:

https://www.fast-report.com

22 / 176

The "Text" object has the following properties which can be set in the "Properties" window:
Property

Description

AllowExpressions

This property allows to turn on or off the expression handling. It is on by default.

Angle

This property indicates the text rotation, in degrees.

AutoShrink

This property allows to shrink the font size or font width automatically to fit the text.

AutoShrinkMinSize

This property determines the minimum size of a font, or the minimum font width ratio, if the
AutoShrink property is used.

AutoWidth

This property allows to calculate the width of object automatically.

Brackets

This property contains a pair of symbols that designate an expression.

BreakToWith this property you can organize the text flow from one text object to another. For example, wehave "A" and "B" text objects. The "A" object contains the long text that does not fit in the object's
bounds. You can set the A.BreakTo to B, so the "B" object will display the part of text that does not
fit in "A".

Clip

This property determines whether it is necessary to clip a text outside of object's bounds. It is on bydefault.

Duplicates

This property determines how the repeated values will be printed.

FirstTabOffset

This property determines the offset of the first TAB symbol, in pixels.

FontWidthRatio

Use this property to make the font wider or narrower. By default the property is set to 1. To makethe font wider, set the property to value > 1. To make the font narrower, set the property to value
between 0 and 1.

HideValue

This property is of string type. It allows to hide values that are equal to the value of this property.

HideZeros

This property allows to hide zero values.

Highlight

This property allows to setup the conditional highlight.

HorzAlign,
VertAlign

These properties determine the text alignment.

HtmlTags

Allows simple HTML tags in the object's text.

LineHeightThis property allows to explicitly set the height of a text line. By default it is set to 0, so the default
line spacing is used.

https://www.fast-report.com

23 / 176

Property

Description

NullValue

The text that will be printed instead of a null value. You also need to uncheck the "Convert nullvalues" option in the "Report/Options..." menu.

Padding

This property allows to setup the padding, in pixels.

RightToLeft

This property indicates whether the text should be displayed in right-to-left order.

TabWidth

This property determines the width of the TAB symbol, in pixels.

Text

This property contains the text of the object.

TextFill

This property determines the text fill. Use this property editor to choose between different fill types.

Trimming

This property determines how to trim the text that does not fit inside the object's bounds. It is used
only if the "WordWrap" property is set to false.

Underlines

This property allows to display a graphical line after each text line. This property can be used only if
the text is top-aligned.

WordWrap

This property determines whether it is necessary to wrap a text by words.

WysiwygThis property changes the display mode of the "Text" object to match the screen and the final
printout. This mode is also used if you use the justify-align or non-standard line height.

https://www.fast-report.com

24 / 176

Rich text
The object "Rich text" allows you to display multiline text in RTF format preserving the layout and styles. On the
toolbar it looks like this:And on the report page, it looks like a simple component "Text":

When possible, it is recommended to use regular "Text" object to display a text. When you export the report tosome document formats, the "Rich Text" object will be exported as a picture.
"Formatted text" can display the data from the source as well as object "Text". To do this, either type the expression
manually or connect components to the data field using the DataColumn property.
The object has the following properties:
Property

Description

AllowExpressions

This property allows to turn on or off the expression handling. It is on by default.

Brackets

This property contains a pair of symbols that designate an expression.

DataColumn

The data column that this object is bound to.

Text

This property contains the RTF text.

Padding

The padding, in pixels.

https://www.fast-report.com

25 / 176

Picture
An object can display graphics in the following formats: BMP, PNG, JPG, GIF, TIFF, ICO, EMF, WMF. With the help of
the "Picture" object, you can print your company logo, a photo of employee or any graphical information. On the
toolbar, it looks like this:And on the report page, it looks like this:An object can show data from the following sources:
Data column - Picture from a data column. Name of the column is stored in the "DataColumn" property.
File with a picture - Picture is loaded from a file and is saved inside the report. Picture is stored in the "Image"property.
Hyperlink – Picture loaded via the link every time the report is built. Picture is not stored within the report.
The address is stored in the property ImageLocation. This may be a URL or link to a local file. In the last case,
you have to distribute the image file together with the report.
In order to call a picture editor, double click on the object. In the editor, you can choose the data source for the
picture:You can also set the image source in the object properties: DataColumn, Image, ImageLocation.
You also can drag&drop a data column from the "Data" window into the report page. In this case the "Picture"object is created which contains a link to the column. The column you drag should have the "byte[]" data type.
The "SizeMode" property determines how the picture is displayed:
AutoSize. The object gets the size of the picture.
CenterImage. The picture is centered inside the object.
Normal. The picture is displayed in the left corner of the object.
StretchImage. The picture is stretched to the size of the object.
Zoom. The picture is stretched to the size of the object in accordance with the aspect ratio.
The difference between modes is shown in the following picture:https://www.fast-report.com

26 / 176

It is possible to rotate the image by using the Angle property. Results of the pictures rotation by a predetermined
angle shown below:

The "Picture" object has the following properties:
Property

Description

Angle

The rotation angle, in degrees. Possible values for this property are 0, 90, 180, 270.

SizeMode

The size mode.

Transparency

The degree of transparency of the pictures. The property can have values between 0 and 1. The value
0 (by default) means that the picture is opaque.

TransparentColor

The color which will be transparent when displaying the picture.

Image

The picture.

DataColumn

The data column that this object is bound to.

ImageLocation

This property can contain name of the file or URL. The picture will be loaded from this location whenbuilding the report.

Padding

The padding, in pixels.

ShowErrorImage

Shows the “No picture” picture, in case when the picture is empty. This property makes sense to use if
the picture is downloaded from the Internet.

https://www.fast-report.com

27 / 176

Line
The "Line" object can display horizontal, vertical or diagonal line. The object is as follows:

On the page, the object is as follows:

If possible, use the object's border instead of "Line" object. This will simplify the report and avoid possible
problems with the export to different formats.
To add a line in the report, click the icon on the toolbar "Components", or drag the icon of the component to thedesired location on the report page. To change the line type from horizontal to vertical or diagonal, set Diagonal
property in the Properties window. An ordinary line differs from a diagonal line in that you can make it only verticalor horizontal.
Do not choose the "Double" line style for this object. This style applies only to the object's border.
The "Line" object has the following properties:
Property

Description

Diagonal

The property determines weather the line is diagonal. An ordinary line can be turned into a diagonal one
by enabling this property.

StartCap,
EndCap

These properties allow to setup the line caps. You can use one of the following cap styles:- ellipse- rectangle- diamond- arrow
Size of the cap can be set in the Width, Height properties of the cap. You can configure caps for each endof the line.

https://www.fast-report.com

28 / 176

ShapeThe "Shape" object displays one of the following shapes:
rectangle;
rounded rectangle;
ellipse;triangle;
diamond.
The object is as follows:

On the toolbar in looks like this:In order to insert a shape into the report, click the the icon in the Components toolbar. Then, select the desired
shape type from the list in the Shape property of the Shape object.
The shape, like any other report object, has a fill and border. Contrary to the "Text" object, you cannot control eachborder line. Also, don't use the "Double" line style.
Instead of rectangular shape, use the object's borders if possible.
The "Shape" object has the following properties:
Property

Description

ShapeThis property determines the type of shape.

Curve

This property is used with the "RoundRectangle" shape. It allows to set the curve.

https://www.fast-report.com

29 / 176

CheckBox
The object displays the checkbox in the report. On the toolbar, it looks as follows:And on the report page – as follows:

The object can display two states: "Checked" and "Unchecked". Use the following ways to handle the object's state:
set the state in the "Checked" property;bind the object to a data column using the "DataColumn" property;
set the expression that returns the true or false in the "Expression" property.
The "CheckBox" object has the following properties:
Property

Description

CheckedSymbol,
UncheckedSymbol

These properties determine the symbol that is shown in the object, depending on the object's
state.

CheckColorThis property determines the color of the check symbol.

CheckWidthRatio

Use this property to set the check width ratio. The width of the check symbol depends on thesize of the object. You can use values in the 0.2 - 2 range.

HideIfUncheckedThis property allows to hide the object if it is unchecked.

CheckedThis property controls the state of the object.

DataColumn

The data column which this object is bound to. The type of column should be either bool or int.

Expression

The expression that returns the true or false.

https://www.fast-report.com

30 / 176

TableThe "Table" object is made up of rows, columns and cells. It is a simplified analog of Microsoft Excel table. It looks
like this:And on the report page – as follows:

You can create a static table, filling cells by hand. And it is possible to create a dynamic table using the fields fromthe data source. An example of a dynamic table is shown below:

The "Table" object has the following properties:
Property

Description

ColumnCountUse this property to quickly set the number of columns. If columns in a table are few, they get added,
and when they are more, they get deleted.

RowCount

Use this property to quickly set the number of rows. If rows in a table are few, they get added, andwhen they are more, they get deleted.

FixedColumns

The property determines how many columns in the table are fixed. Fixed columns form the table header.
Printing of the header is controlled by the "RepeatHeaders" property.

FixedRows

The property determines how many rows in the table are fixed. Fixed rows form the table header.
Printing of the header is controlled by the "RepeatHeaders" property.

RepeatHeaders

The property allows printing the table header on every new page. This property works only for tables
which are formed dynamically.

https://www.fast-report.com

31 / 176

Matrix
The "Matrix" object is, like the "Table" object, made up of rows, columns and cells. At the same time, it is not known
beforehand how many rows and columns will be in the matrix - this depends on the data to which it is connected.
On the toolbar it looks like this:And on the page, it is as follows:

Object matrix can be filled with data manually. But you also can create a dynamic matrix with fields from data
source:The "Matrix" object has the following properties:
Property

Description

RepeatHeaders

If matrix is divided on several pages, this property allows printing matrix header on each new page.

CellsSideBySide

This property determines how matrix cells will be located if the matrix has several data cell levels.
Possible variants:- the cells are displayed side by side;- the cells are displayed under each other.

Style

Using this property you can set a style for the whole matrix. You can choose one from predefinedstyles.

AutoSizeThis property allows to calculate the matrix size automatically. Disable it if you want to control theobject size manually.

DataSource

The property allows connecting the matrix to the data source. This property is set up automaticallywhen you drag data column to the matrix. However, if you use expressions in cells,check that thisproperty was set up correctly.

FilterThis property contains expression for data filtering which will be applicable to data source of the matrix(see "DataSource" property).

https://www.fast-report.com

32 / 176

Barcode
The object displays barcodes in the report. It looks like this:And on the report page, it is as follows:

The object supports the following types of barcodes:
Code

LengthAllowed symbols

2 of 5 Interleaved

0-9

2 of 5 Industrial

0-9

2 of 5 Matrix

0-9

Codabar

0-9, -$:/.+

Code128

128 ASCII chars

Code390-9,A-Z, -. *$/+%

Code39 Extended

128 ASCII chars

Code930-9,A-Z, -. *$/+%

Code93 Extended

128 ASCII chars

EAN8

8

0-9

EAN13

13

0-9

MSI

0-9

PostNet

0-9

UPC A

12

0-9

UPC E06

0-9

UPC E160-9

https://www.fast-report.com

33 / 176

Code

LengthAllowed symbols

2-Digit Supplement

20-9

5-Digit Supplement

5

0-9

PDF417any

Datamatrix

any

QR code

any

Aztec

any

Barcode data in an object is of a string type. The string can contain any symbol, allowed for the chosen type ofbarcode. You can choose the type of barcode in the context menu of the "Barcode" object.
You can connect an object to data by using one of the following methods:
set the barcode data in the "Text" property;bind the object to a data column using the "DataColumn" property;
set the expression that returns the barcode data in the "Expression" property.
The "Barcode" object has the following properties:
Property

Description

BarcodeThis property contains barcode-specific settings. Expand this property to set these settings.

Angle

This property determines the rotation of a barcode, in degrees. You can use one of the following values: 0,
90, 180, 270.

Zoom

This property allows to zoom a barcode. It is used along with the "AutoSize" property.

AutoSize

If this property is on, the object will stretch in order to display a whole barcode. If this property is off, thebarcode will stretch to to object's bounds.

ShowText

This property determines whether it is necessary to show the human-readable text.

DataColumn

The data column which this object is bound to.

Expression

The expression that returns the barcode data.

Text

The barcode data.

Padding

The padding, in pixels.

The following properties are specific to the barcode type. To change them, select the barcode, go "Properties"
window and expand the "Barcode" property.

https://www.fast-report.com

34 / 176

Property

Description

WideBarRatio

This property is specific to all linear barcodes. It determines the wide-to-narrow bar ratio. For most of
barcode types, the value for this property should be between 2 and 3.

CalcCheckSum

This property is specific to all linear barcodes. It determines whether is necessary to calculate thecheck sum automatically. If this property is off, you should provide the check digit in the barcode
data.

AutoEncode

This property is specific to the Code128 barcode. This code has three different encodings - A, B, C.
You should either set the encoding explicitly in the barcode data, or set this property to true. In thiscase the encoding will be chosen automatically.
Use the following control codes in the barcode data:&A; START A / CODE A&B; START B / CODE B&C; START C / CODE C&S; SHIFT&1; FNC1&2; FNC2&3; FNC3&4; FNC4
If you set the "AutoEncode" property to true, all control codes will be ignored. Example of use thecontrol codes:&C;1234&B;ABC

AspectRatio

This property is specific to the PDF417 barcode. It determines the height-to-width aspect ratio and isused to calculate the barcode size automatically (in case the "Columns" and "Rows" properties are not
set).

CodePageThis property is specific to the PDF417 and Datamatrix barcode. It determines the code page which isused to convert non-ASCII chars. For example, the default windows codepage is 1251.

Columns, Rows

These properties are specific to the PDF417 barcode. They determine the number of columns androws in a barcode. If both properties are set to 0, the size of the barcode will be calculated
automatically. In this case the "AspectRatio" property is used as well.

CompactionMode

This property is specific to the PDF417 barcode. It determines the PDF417 data compaction mode.

ErrorCorrection

This property is specific to the PDF417 barcode. It determines the error correction level.

PixelSize

This property is specific to the PDF417 barcode. It determines the size of barcode element, in screen
pixels. As a rule, the element's height should be greater than the element width by 3 times or more.

Encoding

This property is specific to the Datamatrix barcode. It determines the Datamatrix data encoding.

PixelSize

This property is specific to the Datamatrix barcode. It determines the size of barcode element, inpixels.

SymbolSize

This property is specific to the Datamatrix barcode. It determines the size of barcode symbol.

https://www.fast-report.com

35 / 176

Cellular text
This object can display each character of a text in its individual cell. It is often used to print some forms in financial
applications. On the toolbar it looks like this:On the report page, the object is as follows:

In fact, this object is directly inherited from the "Text" object. You may connect it to data in the same manner. For
example, you may invoke the object's editor and type the following text:[Employees.FirstName]

The "Cellular Text" object has the following properties:
Property

Description

CellWidth,
CellHeight

These properties determine the size of a single cell. If both properties are 0 (by default), the cell size will
be calculated automatically, depending on the font used.

HorzSpacing,
VertSpacing

These properties determine the horizontal and vertical gap between adjacent cells.

https://www.fast-report.com

36 / 176

Linear scale, simple scale
Some reports may require displaying information, such as gauge, like on the dashboard of industrial facilities. In
FastReport there are two components to display information in the form of linear and simple gauge. On the
toolbar, they are depicted as follows:And on the report page – as follows:

The appearance of the component can be set using the properties Pointer and Scale in the Properties window. You
can set the color of scales and indicator, the text font and line width. To display the gauge value, set an expression
in the Expression property. This expression can be a field from the data source.

https://www.fast-report.com

37 / 176

Report creation
In this chapter we will look at the methods of creating common types of reports. In order to create any report, as arule, you need to do the following:
1. Choose or create data, which will be used in the report.
2. Create the report structure, by adding the needed bands into the report.
3. Connect the band to a data source.
4. Place the "Text" objects on the bands to print data.
5. Setup the appearance, formatting.

https://www.fast-report.com

38 / 176

Dynamic layout
It is necessary often to print a text whose size is not known when creating a report. For example, this can be adescription of goods. In this case, the following tasks will need to be solved:
calculate the height of the object, such that it encloses the whole text;
calculate the height of the band, such that it encloses the object with a variable amount of texts;
move or change the height of other objects, which are contained on the band, such that, they do not disturb
the general design of the report.
These tasks can be solved by using some object and band properties:"CanGrow" and "CanShrink" properties allow calculating the height of the object automatically;"ShiftMode" property allows moving objects that are located under the objects that expand;"GrowToBottom" property allows resizing an object to the bottom edge of the band;"Anchor" and "Dock" properties allow controlling the size of objects depending on the size of the band.
All these properties will be looked at below.

https://www.fast-report.com

39 / 176

CanGrow and CanShrink properties
Every band and report object has these properties. They determine whether an object can grow or shrink
depending on the size of its contents. If both properties are disabled, the object always has the size specified in thedesigner.
These properties are very useful, if it is needed to print a text whose size is not known when designing. In order foran object to accommodate the entire text, it needs to have the "CanGrow" and "CanShrink" properties enabled:

The following objects can affect the height of a band:"Text";"Rich Text";"Picture" (with "AutoSize" property enabled);"Table".

https://www.fast-report.com

40 / 176

ShiftMode property
Every report object has this property. This property is accessible only in the "Properties" window. An object, whose"ShiftMode" property is enabled, will be moving up and down, if the object above on can either grow or shrink.

The "ShiftMode" property can have one of the following values:
Always (by default). Meaning that the object needs to shift always.
Never. Implies that the object does not need to shift.
WhenOverlapped. Implies that the object needs to shift in that case, if the expanding object is located exactly
over it (that is, both objects overlap horizontally).
This property is convenient to use when printing information in a table form, when several cells of the table arelocated on top of each other and can have a variable amount of text.

https://www.fast-report.com

41 / 176

GrowToBottom property
Every report object has this property. When printing an object with this property, it stretches up to the bottom edgeof a band:

This is needed when printing information in a table form. In a table row there can be several objects which canstretch. This property makes it possible to set all objects' height to the maximum height of the band.

https://www.fast-report.com

42 / 176

Anchor property
Every report object has this property. It determines how the object will be changing its position and/or its size when
the container on which it is laying will be changing its size. By using Anchor, it can be done in such a way that, theobject expands or moves synchronously with its container.
The container, being referred to, in many cases will be the band. But this is not a must - this can also be the "Table"or "Matrix" objects.
The "Anchor" property can have one of the following values, and also any combination of them:
Value

Description

Left

Anchors the left edge of the object. When the container's size will be changing, the object will not be moving
left/right.

Top

Anchors the top edge of the object .When the container's height will be changing, the object will not be moving
up/down.

Right

Anchors the right edge of the object .When the container's width will be changing , the distance between theright edge of the object and the container will be constant. If the left edge of the container is anchored as well,then the object will be growing and shrinking synchronously with container.

BottomAnchors the bottom edge of the object. When the container's height will be changing, the distance between thebottom edge of the object and the container will be constant. If the top edge of the object is anchored as well,
the object will be growing and shrinking synchronously with container.

By default, the value of this property is Left, Top. This means that, when the container's size will be changing, theobject will not be changing. In the table below, combinations of some frequent used values are given:
Value

Description

Left, Top

Value by default. The object does not change when the size of the container changes.

Left, Bottom

The object moves up/down when the height of the container changes. The position of the object inrelation to the bottom edge of the container does not change.

Left, Top,
BottomWhen the height of the container is changing, the height of the object synchronously changes with it.

Left, Top,
Right, Bottom

When the width and the height of the container are changing, the object grows or shrinks synchronouslywith it.

https://www.fast-report.com

43 / 176

Dock property
Every report object has this property. This property determines on which side of the container the object will be
docked.
The "Dock" property can have one of the following values:
Value

Description

None

Value by default. The object is not docked.

Left

The object is docked to the left edge of the container. The height of the object will be equal to the height of thecontainer*.

Top

The object is docked to the top edge of the container. The width of the object will be equal to the width of thecontainer*.

Right

The object is docked to the right edge of the container. The height of the object will be equal to the height of thecontainer*.

BottomThe object is docked to the lower edge of the container. The width of the object will be equal to the width of thecontainer*.

Fill

The object occupies all the free space of the container.

This is not quite so, if several objects have been docked at the same time. The figure below shows two objects,
the first one has been docked to the top edge of the container and the second - to the left:

As seen, the height of the second object is equal to height of the free space, which remains after docking the firstobject.
The docking behavior depends on the object's creation order. You can change the order in the context menu ofan object. To do this, select either the "Bring to front" or "Send to back" menu items.

https://www.fast-report.com

44 / 176

Formatting
Border and fill
Almost all report objects have the border and fill. To work with these properties, use the "Borders" toolbar:

The object's border consists of four lines. Each line can have different width, color and style. The toolbar buttons
affect all lines of frame. The color, width and style can be set for each border line separately (in the Properties
window).

https://www.fast-report.com

45 / 176Text formatting
The toolbars "Font" and "Alignment" are located on the tab "Home":

Here you can: choose and customize the font, change the position of text within a component (left, right, center)vertically and horizontally, set the text color.

https://www.fast-report.com

46 / 176

Data formatting
The text component displays data in the format in which they are stored in the data source. It is not always
convenient. For example, when the date contains the time. To display only the date, it is necessary to resort toformatting the data. This can be done through using system functions String.Format. Print the current date without
time:

Today [String.Format("{0:d}", [Date])]https://www.fast-report.com

47 / 176

Hiding values
The "Text" object has the "HideZeros" property which can be used to hide zero values. Lets look at an object withthe following contents:

Total elements: [CountOfElements]

If the value of variable CountOfElements is equal to 0, and the property HideZeros is set to true, the object will be
printed as follows:

Total elements:

The "Text" object also has the "HideValue" property which can be used to hide the value of an expression which isequal to the given value. For example, if the property value is "0", then all the zero fields will be hidden. This
property can also be used for hiding zero dates. As a rule, it's a date like "1.1.0001" or "1.1.1900". In this case thevalue of "HideValue" property must be like this:1.1.1900 0:00:00

As you can see, apart from the date, you need to indicate time as well. This is necessary because the value of thedate in .Net contains time also.
Important note: this mechanism depends on the regional settings of your system, which can be set in thecontrol panel. This happens because FastReport compares strings using the "ToString()" method. This method
converts an expression value into a string. In relation with this, be careful when building reports which can belaunched on a computer with different regional settings.
Finally, the "NullValue" property of the "Text" object allows to print some text instead of a null value. It is often used
to print the dash instead of a null value. Lets look at an object with the following contents:

Total elements: [CountOfElements]

If the value of variable CountOfElements is null, and the property NullValue is set to --, the object will be printed asfollows:

Total elements: --The "Text" object has "Duplicates" property which allows to control how duplicate values will be printed. This
property can be used if the "Text" object is on the "Data" band. The values considered duplicate if they are printed in
the near by data rows.
The "Duplicates" property can have one of the following values:

https://www.fast-report.com

48 / 176Show - show the duplicates (by default).
Hide - hide the object with duplicate value.
Clear - clear the object's text, but show the object.
Merge - merge several objects with the same value.
The difference between these modes in shown in the figure below:

https://www.fast-report.com

49 / 176

Subreports
Sometimes at a certain place of the main report, extra data needs to be shown, this can be a separate report with avery complicated structure. You can try to solve this task by using FastReport's rich collection of bands. However, incertain cases, it is preferable to use the "Subreport" object. Component "Subreport" looks like this:The "Subreport" object is an ordinary report object, which can be placed on one of the bands. When you do this,FastReport adds an extra page into the report and connects it with the subreport. On this page it is possible tocreate an extra report, having any structure.
When printing the report, in which there is the "Subreport" object, the following will be done:
1. The main report will be printed, while the "Subreport" object is not met;
2. The subreport bands will be printed;
3. Printing of the main report will continue.
Since subreport is formed on the sheet of the main report, it cannot contain the following bands: "Report
header/footer", "Page header/footer", "Column header/footer", "Overlay".

https://www.fast-report.com

50 / 176

Working with data
Data source
Please, note that the database user that is used to create the connection must have limited rights to modify the
database, as well as rights to view private data. Otherwise, you allow full access to the database to any user who
runs the report generator with this template.
FastReport Online Designer does not have the ability to add data sources, but you can create a connection throughthe connection wizard by setting the required connector on the server. Also, if you open a report with a data source
added, it will be shown in the Data window. You can drag fields from a data source onto the report page. This will
create a text object with a link to the data field.

The source data can contain related tables. That is, the tables have a relationship on the key field that allows you tocreate reports of type "Master-detail". One record in the primary table will match one or more records in the detailtable. FastReport Online Designer cannot create the relationship, but allows to use them when working with thealready created reports.

https://www.fast-report.com

51 / 176

System variables
There is a list of system variables that can be used in a report:
Variable

Description

Date

Date and time of the report's start.

Page

Current page number.

TotalPages

Total number of pages in the report. To use this variable, you need to enable thereport's double pass. You can do this in "Report

PageN

Page number in the form: "Page N".

PageNofM

Page number in the form: "Page N of M".

Row#

Data row number inside the group. This value is reset at the start of a new group.

AbsRow#

Absolute number of data row. This value is never reset at the start of a new group.

Page#

Current page number. If you join several prepared reports into one package, thisvariable will return current page number in a package.This variable is actually a macro.
It value is substituted when the component is viewed in the preview window. Thatmeans you cannot use it in an expression.

TotalPages#

Total number of pages in the report. If you join several prepared reports into one
package, this variable will return the number of pages in a package. You don't need touse double pass to get the correct value.This variable is actually a macro. It value issubstituted when the component is viewed in the preview window. That means you
cannot use it in an expression.

HierarchyLevel

Current level of hierarchy in a hierarchical report. The top level is equal to 1.

HierarchyRow#

Full row number like "1.2.1" in a hierarchical report.

https://www.fast-report.com

Properties..."menu.

52 / 176

Functions
FastReport.Net contains a lot of built-in functions (over 60). All functions are splitted to several categories and areaccessible through the "Data" window:

You may use a function in any expression, in the script (see the "Script" chapter), or print its value in the "Text"
object. For example, the following text in the "Text" object:[Sqrt(4)]will be printed as "2" (square root of 4).
The following expression will return 4:

Sqrt(4) + 2

Let us look at the ways to insert a function in a report:
you may drag&drop a function from the "Data" window to a report page. The "Text" object will be created,which contains a function call. You have to edit the text to add parameters to the function call;you can drag&drop a function to the script code;in the expression editor, you can see a copy of the "Data" window which acts the same way - you may dragitems from it and drop them in the expression text.
Below we will describe each function in details.

https://www.fast-report.com

53 / 176

Mathematical
Abs
Function

Parameters

Return valueAbssbyte value

sbyte

Abs

short value

short

Abs

int value

int

Abs

long value

long

Abs

float value

float

Abs

double value

doubleAbsdecimal value

decimalReturns the absolute value.
Example:Abs(-2.2) = 2.2

https://www.fast-report.com

54 / 176

Acos
Function

Parameters

Return value

Acos

double ddoubleReturns the angle (in radians) whose cosine is d. d must be in range between -1 and 1.
Multiply the return value by 180 / Math.PI to convert from radians to degrees.
Example:Acos(0) * 180 / Math.PI = 90

https://www.fast-report.com

55 / 176

AsinFunction

Parameters

Return value

Asindouble ddoubleReturns the angle (in radians) whose sine is d. d must be in range between -1 and 1.
Multiply the return value by 180 / Math.PI to convert from radians to degrees.
Example:Asin(0) = 0

https://www.fast-report.com

56 / 176

AtanFunction

Parameters

Return value

Atan

double ddoubleReturns the angle (in radians) whose tangent is d.
Multiply the return value by 180 / Math.PI to convert from radians to degrees.
Example:Atan(1) * 180 / Math.PI = 45

https://www.fast-report.com

57 / 176

Ceiling
Function

Parameters

Return value

Ceiling

double ddoubleCeiling

decimal ddecimalReturns the smallest integer greater than or equal to d.
Example:Ceiling(1.7) = 2

https://www.fast-report.com

58 / 176

Cos
Function

Parameters

Return value

Cosdouble ddoubleReturns the cosine of the specified angle (d). The angle must be in radians.
Multiply by Math.PI / 180 to convert degrees to radians.
Example:Cos(90 * Math.PI / 180) = 0

https://www.fast-report.com

59 / 176

Exp
Function

Parameters

Return valueExp

double ddoubleReturns e (2.71828), raised to the specified power d.
Example:Exp(1) = 2.71828

https://www.fast-report.com

60 / 176

FloorFunction

Parameters

Return value

Floor

double ddoubleFloor

decimal ddecimalReturns the largest integer less than or equal to d.
Example:Floor(1.7) = 1

https://www.fast-report.com

61 / 176

Log
Function

Parameters

Return value

Log

double ddoubleReturns the logarithm of a specified number d.
Example:Log(2.71828) = 1

https://www.fast-report.com

62 / 176

Maximum
Function

Parameters

Return value

Maximum

int val1,``int val2

int

Maximumlong val1,``long val2

long

Maximum

float val1,``float val2

float

Maximum

double val1,``double val2

doubleMaximum

decimal val1,``decimal val2

decimalReturns the larger of val1, val2.
Example:Maximum(1,2) = 2

https://www.fast-report.com

63 / 176

Minimum
Function

Parameters

Return value

Minimum

int val1,``int val2

int

Minimumlong val1,``long val2

longMinimum

float val1,``float val2

float

Minimum

double val1,``double val2

doubleMinimum

decimal val1,``decimal val2

decimalReturns the smaller of val1, val2.
Example:Minimum(1,2) = 1

https://www.fast-report.com

64 / 176

RoundFunction

Parameters

Return value

Round

double ddoubleRounddecimal ddecimalRounds d to the nearest integer.
Example:Round(1.47) = 1

Function

Parameters

Return value

Round

double d,``int digits

doubleRounddecimal d,``int digits

decimalRounds d to a precision specified in the "digits" parameter.
Example:Round(1.478, 2) = 1.48

https://www.fast-report.com

65 / 176

Sin
Function

Parameters

Return valueSindouble ddoubleReturns the sine of the specified angle (d). The angle must be in radians.
Multiply by Math.PI / 180 to convert degrees to radians.
Example:Sin(90 * Math.PI / 180) = 1

https://www.fast-report.com

66 / 176

Sqrt
Function

Parameters

Return value

Sqrt

double ddoubleReturns the square root of d.
Example:Sqrt(4) = 2

https://www.fast-report.com

67 / 176

Tan
Function

Parameters

Return valueTandouble ddoubleReturns the tangent of the specified angle (d). The angle must be in radians.
Multiply by Math.PI / 180 to convert degrees to radians.
Example:Tan(45 * Math.PI / 180) = 1

https://www.fast-report.com

68 / 176

Truncate
Function

Parameters

Return value

Truncate

double ddoubleTruncate

decimal ddecimalCalculates the integral part of d.
Example:Truncate(1.7) = 1

https://www.fast-report.com

69 / 176

Text
Note:
these functions do not modify the string value passed in. Instead, they return a new modified string;
the first character in a string has 0 index. Keep it in mind when working with functions that take the character
index, such as Insert.

https://www.fast-report.com

70 / 176

Asc
Function

Parameters

Return valueAscchar cint

Returns an Integer value representing the character code corresponding to a character.
Example:Asc('A') = 65

https://www.fast-report.com

71 / 176

Chr
Function

Parameters

Return value

Chr

int i

char

Returns the character associated with the specified character code.
Example:Chr(65) = 'A'

https://www.fast-report.com

72 / 176

InsertFunction

Parameters

Return value

Insertstring s, ``int startIndex,``string value

stringInserts a "value" substring into the "s" string at a specified index position "startIndex" and returns a new string.
Example:Insert("ABC", 1, "12") = "A12BC"

https://www.fast-report.com

73 / 176

LengthFunction

Parameters

Return value

Lengthstring s

int

Returns the length of "s".
Example:Length("ABC") = 3

https://www.fast-report.com

74 / 176

LowerCase
Function

Parameters

Return value

LowerCasestring s

stringConverts all characters of "s" to lower case and returns a result.
Example:LowerCase("ABC") = "abc"https://www.fast-report.com

75 / 176

PadLeft
Function

Parameters

Return value

PadLeftstring s, ``int totalWidth

stringRight-aligns the characters in the "s" string, padding with spaces on the left for a total width specified in the"totalWidth" parameter.
Example:PadLeft("ABC", 5) = " ABC"

Function

Parameters

Return value

PadLeftstring s, ``int totalWidth,``char paddingChar

stringRight-aligns the characters in the "s" string, padding with "paddingChar" characters on the left for a total width
specified in the "totalWidth" parameter.
Example:PadLeft("ABC", 5, '0') = "00ABC"

https://www.fast-report.com

76 / 176

PadRight
Function

Parameters

Return value

PadRight

string s, ``int totalWidth

stringLeft-aligns the characters in the "s" string, padding with spaces on the right for a total width specified in the"totalWidth" parameter.
Example:PadRight("ABC", 5) = "ABC "Function

Parameters

Return value

PadRight

string s, ``int totalWidth,``char paddingChar

stringLeft-aligns the characters in the "s" string, padding with "paddingChar" characters on the right for a total width
specified in the "totalWidth" parameter.
Example:PadRight("ABC", 5, '0') = "ABC00"

https://www.fast-report.com

77 / 176

Remove
Function

Parameters

Return value

Removestring s, ``int startIndex

stringDeletes all the characters from the "s" string beginning at "startIndex" position and continuing through the last
position.
Example:Remove("ABCD", 3) = "ABC"

Function

Parameters

Return value

Removestring s, ``int startIndex,``int countstringDeletes a number of characters specified in the "count" parameter from the "s" string, beginning at a "startIndex"
position.
Example:Remove("A00BC", 1, 2) = "ABC"https://www.fast-report.com

78 / 176

Replace
Function

Parameters

Return value

Replacestring s, ``string oldValue, ``string newValue

stringReturns a string "s" in which a specified substring "oldValue" has been replaced with another substring "newValue".
Example:Replace("A00", "00", "BC") = "ABC"https://www.fast-report.com

79 / 176

Substring
Function

Parameters

Return value

Substring

string s, ``int startIndex

stringRetrieves a substring from the "s" string. The substring starts at a character position specified in the "startIndex"
parameter.
Example:Substring("ABCDEF", 4) = "EF"

Function

Parameters

Return value

Substring

string s, ``int startIndex,``int length

stringRetrieves a substring from the "s" string. The substring starts at a character position specified in the "startIndex"
parameter and has a length specified in the "length" parameter.
Example:Substring("ABCDEF", 1, 3) = "BCD"

https://www.fast-report.com

80 / 176

TitleCase
Function

Parameters

Return value

TitleCasestring s

stringConverts the specified string to titlecase.
Example:TitleCase("john smith") = "John Smith"https://www.fast-report.com

81 / 176

Trim
Function

Parameters

Return valueTrimstring s

stringRemoves all occurrences of white space characters from the beginning and end of the "s" string.
Example:Trim(" ABC ") = "ABC"https://www.fast-report.com

82 / 176

UpperCase
Function

Parameters

Return value

UpperCasestring s

stringConverts all characters of "s" to upper case and returns a result.
Example:UpperCase("abc") = "ABC"https://www.fast-report.com

83 / 176

Date & Time
AddDays
Function

Parameters

Return value

AddDays

DateTime date,``double value

DateTime

Adds the specified number of days ("value") to the "date" date and returns a new date.
Example:AddDays(#7/29/2009#, 1) = #7/30/2009#https://www.fast-report.com

84 / 176

AddHours
Function

Parameters

Return value

AddHours

DateTime date,``double value

DateTime

Adds the specified number of hours ("value") to the "date" date and returns a new date.
Example:AddHours(#7/29/2009 1:30#, 1) = #7/29/2009 2:30#

https://www.fast-report.com

85 / 176

AddMinutes
Function

Parameters

Return value

AddMinutes

DateTime date,``double value

DateTime

Adds the specified number of minutes ("value") to the "date" date and returns a new date.
Example:AddMinutes(#7/29/2009 1:30#, 1) = #7/29/2009 1:31#

https://www.fast-report.com

86 / 176

AddMonths
Function

Parameters

Return value

AddMonths

DateTime date,``int value

DateTime

Adds the specified number of months ("value") to the "date" date and returns a new date.
Example:AddMonths(#7/29/2009#, 1) = #8/29/2009#https://www.fast-report.com

87 / 176

AddSeconds
Function

Parameters

Return value

AddSeconds

DateTime date,``double value

DateTime

Adds the specified number of seconds ("value") to the "date" date and returns a new date.
Example:AddSeconds(#7/29/2009 1:30:01#, 1) = #7/29/2009 1:30:02#

https://www.fast-report.com

88 / 176

AddYears
Function

Parameters

Return value

AddYears

DateTime date,``int value

DateTime

Adds the specified number of years ("value") to the "date" date and returns a new date.
Example:AddYears(#7/29/2009#, 1) = #7/29/2010#https://www.fast-report.com

89 / 176

DateDiff
Function

Parameters

Return value

DateDiff

DateTime date1,``DateTime date2

TimeSpan

Returns the interval (number of days, hours, minutes, seconds) between two dates.
Example:DateDiff(#1/2/2009#, #1/1/2009#) = 1.00:00:00

https://www.fast-report.com

90 / 176

DateSerial
Function

Parameters

Return value

DateSerial

int year,``int month,``int day

DateTime

Creates a new DateTime value from the specified year, month and day.
Example:DateSerial(2009, 7, 29) = #7/29/2009#https://www.fast-report.com

91 / 176

Day
Function

Parameters

Return value

Day

DateTime date

int

Gets the day of the month (1-31) represented by the specified date.
Example:Day(#7/29/2009#) = 29

https://www.fast-report.com

92 / 176

DayOfWeek
Function

Parameters

Return value

DayOfWeek

DateTime datestringGets the localized name of the day of the week represented by the specified date.
Example:DayOfWeek(#7/29/2009#) = "wednesday"

https://www.fast-report.com

93 / 176

DayOfYear
Function

Parameters

Return value

DayOfYear

DateTime date

int

Gets the day of the year (1-365) represented by the specified date.
Example:DayOfYear(#7/29/2009#) = 210

https://www.fast-report.com

94 / 176

DaysInMonth
Function

Parameters

Return value

DaysInMonthint year,``int month

int

Returns the number of days in the specified month and year.
Example:DaysInMonth(2009, 7) = 31

https://www.fast-report.com

95 / 176

Hour
Function

Parameters

Return value

Hour

DateTime date

int

Gets the hour component (0-23) represented by the specified date.
Example:Hour(#7/29/2009 1:30#) = 1

https://www.fast-report.com

96 / 176

MinuteFunction

Parameters

Return value

MinuteDateTime date

int

Gets the minute component (0-59) represented by the specified date.
Example:Minute(#7/29/2009 1:30#) = 30

https://www.fast-report.com

97 / 176

MonthFunction

Parameters

Return value

Month

DateTime date

int

Gets the month component (1-12) represented by the specified date.
Example:Month(#7/29/2009#) = 7

https://www.fast-report.com

98 / 176

MonthName
Function

Parameters

Return value

MonthName

int monthstringGets the localized name of the specified month (1-12).
Example:MonthName(1) = "January"https://www.fast-report.com

99 / 176

SecondFunction

Parameters

Return value

SecondDateTime date

int

Gets the seconds component (0-59) represented by the specified date.
Example:Second(#7/29/2009 1:30:05#) = 5

https://www.fast-report.com

100 / 176

Year
Function

Parameters

Return value

Year

DateTime date

int

Gets the year component represented by the specified date.
Example:Year(#7/29/2009#) = 2009https://www.fast-report.com

101 / 176

Formatting
FormatFunction

Parameters

Return value

Formatstring format,``params object[] args

stringReplaces the format item in a specified "format" string with the value of a corresponding Object instance in a
specified "args" array.
For example, the following function call:Format("Name = {0}, hours = {1:hh}", myName, DateTime.Now)

contains the following format items: "{0}" and "{1:hh}". They will be replaced with values of myName and
DateTime.Now. The result may look as follows:

Name = Alex, hours = 12

Each format item takes the following form:{index[,alignment][:formatString]}

index - a zero-based integer that indicates which element in a list of objects to format;alignment - an optional integer indicating the minimum width of the region to contain the formatted value. If
the length of the formatted value is less than alignment, then the region is padded with spaces. If alignment isnegative, the formatted value is left justified in the region; if alignment is positive, the formatted value is rightjustified;formatString -an optional string of format specifiers.
The following table describes the standard numeric format strings.
FormatSpecifierName

Description

C or cCurrency

The number is converted to a string that represents a currency amount.
Format("{0:C}", 10) = "$10.00"

D or dDecimalThis format is supported for integral types only. The number is converted to a string of decimal
digits (0-9). Format("{0:D}", 10) = "10"E or eScientific

The number is converted to a string of the form "-d.ddd…E+ddd" or "-d.ddd…e+ddd", where
each 'd' indicates a digit (0-9). Format("{0:E}", 10) = "1,000000E+001"

https://www.fast-report.com

102 / 176

FormatSpecifierName

Description

F or fFixed-point

The number is converted to a string of the form "-ddd.ddd…" where each 'd' indicates a digit(0-9). Format("{0:F}", 10) = "10.00"

G or gGeneralThe number is converted to the most compact notation. Format("{0:G}", 10) = "10"N or nNumber

The number is converted to a string of the form "-d,ddd,ddd.ddd…", where each 'd' indicates adigit (0-9). Format("{0:N}", 1234.56) = "1,234.56"

P or p

Percent

The number is converted to a string that represents a percent. The converted number ismultiplied by 100 in order to be presented as a percentage.
Format("{0:P}", 0.15) = "15.00%"

X or xHexadecimal

The number is converted to a string of hexadecimal digits. The case of the format specifierindicates whether to use uppercase or lowercase characters for the hexadecimal digits greaterthan 9. For example, use 'X' to produce "ABCDEF", and 'x' to produce "abcdef".
Format("{0:X}", 26) = "1A"

If you format the floating-point values, you may indicate a number of decimal places after the format string:Format("{0:C1}", 12.23) = "$12.2"

If the standard numeric format specifiers do not provide the type of formatting you require, you can use custom
format strings:
Formatcharacter

Description

0

Zero placeholder. If the value being formatted has a digit in the position where the '0' appears in the format
string, then that digit is copied to the result string. The position of the leftmost '0' before the decimal point andthe rightmost '0' after the decimal point determines the range of digits that are always present in the result
string.

#Digit placeholder. If the value being formatted has a digit in the position where the '#' appears in the format
string, then that digit is copied to the result string. Otherwise, nothing is stored in that position in the result
string.

.

Decimal point. The first '.' character in the format string determines the location of the decimal separator in theformatted value.

,

Thousand separator. If the format string contains a ',' character, then the output will have thousand separators
inserted between each group of three digits to the left of the decimal separator.

%

Percentage placeholder. The presence of a '%' character in a format string causes a number to be multiplied by
100 before it is formatted.

;

Section separator. The ';' character is used to separate sections for positive, negative, and zero numbers in theformat string.

Examples of use:

https://www.fast-report.com

103 / 176

Format("{0:$#,##0.00}", 1024.25) = "$1,024.25"
Format("{0:00%}", 0.25) = "25%"
Format("{0:$#,##0.00;($#,##0.00);Zero}", 1024.25) = "$1,024.25"
Format("{0:$#,##0.00;($#,##0.00);Zero}", -1024.25) = "($1,024.25)"
Format("{0:$#,##0.00;($#,##0.00);Zero}", 0) = "Zero"

The following table describes the standard format specifiers for formatting the DateTime values:
Format Specifier

Name

ExampledShort date pattern"8/9/2009"

D

Long date pattern"Sunday, August 09, 2009"fFull date/time pattern (short time)"Sunday, August 09, 2009 2:44 PM"

F

Full date/time pattern (long time)"Sunday, August 09, 2009 2:44:01 PM"

g

General date/time pattern (short time)"8/9/2009 2:44 PM"

G

General date/time pattern (long time)"8/9/2009 2:44:01 PM"t

Short time pattern"2:44 PM"

TLong time pattern"2:44:01 PM"

The following table describes the custom date/time format specifiers and the results they produce.
FormatSpecifierDescriptiond

Displays the current day of the month, measured as a number between 1 and 31, inclusive. If the day is a single
digit only (1-9), then it is displayed as a single digit.

ddDisplays the current day of the month, measured as a number between 1 and 31, inclusive. If the day is a single
digit only (1-9), it is formatted with a preceding 0 (01-09).

ddd

Displays the abbreviated name of the day.

dddd

Displays the full name of the day.

f or F

Displays the most significant digit of the seconds fraction.

hDisplays the hour in the range 1-12. If the hour is a single digit (1-9), it is displayed as a single digit.

hh

Displays the hour in the range 1-12. If the hour is a single digit (1-9), it is formatted with a preceding 0 (01-09).

H

Displays the hour in the range 0-23. If the hour is a single digit (1-9), it is displayed as a single digit.

HH

Displays the hour in the range 0-23. If the hour is a single digit (1-9), it is formatted with a preceding 0 (01-09).

https://www.fast-report.com

104 / 176

FormatSpecifierDescriptionm

Displays the minute in the range 0-59. If the minute is a single digit (0-9), it is displayed as a single digit.

mm

Displays the minute in the range 0-59. If the minute is a single digit (0-9), it is formatted with a preceding 0(01-09).

M

Displays the month, measured as a number between 1 and 12, inclusive. If the month is a single digit (1-9), it isdisplayed as a single digit.

MM

Displays the month, measured as a number between 1 and 12, inclusive. If the month is a single digit (1-9), it isformatted with a preceding 0 (01-09).

MMM

Displays the abbreviated name of the month.

MMMM

Displays the full name of the month.

s

Displays the seconds in the range 0-59. If the second is a single digit (0-9), it is displayed as a single digit only.

ss

Displays the seconds in the range 0-59. If the second is a single digit (0-9), it is formatted with a preceding 0(01-09).

t

Displays the first character of the A.M./P.M. designator.

tt

Displays the A.M./P.M. designator.

y

Displays the year as a maximum two-digit number. The first two digits of the year are omitted. If the year is asingle digit (1-9), it is displayed as a single digit.

yy

Displays the year as a maximum two-digit number. The first two digits of the year are omitted. If the year is asingle digit (1-9), it is formatted with a preceding 0 (01-09).

yyyy

Displays the year, including the century. If the year is less than four digits in length, then preceding zeros areappended as necessary to make the displayed year four digits long.

z

Displays the time zone offset for the system's current time zone in whole hours only. The offset is always
displayed with a leading sign (zero is displayed as "+0"), indicating hours ahead of Greenwich mean time (+) or
hours behind Greenwich mean time (-). The range of values is –12 to +13. If the offset is a single digit (0-9), it isdisplayed as a single digit with the appropriate leading sign.

zz

Displays the time zone offset for the system's current time zone in whole hours only. The offset is always
displayed with a leading or trailing sign (zero is displayed as "+00"), indicating hours ahead of Greenwich meantime (+) or hours behind Greenwich mean time (-). The range of values is –12 to +13. If the offset is a single
digit (0-9), it is formatted with a preceding 0 (01-09) with the appropriate leading sign.

zzz

Displays the time zone offset for the system's current time zone in hours and minutes. The offset is always
displayed with a leading or trailing sign (zero is displayed as "+00:00"), indicating hours ahead of Greenwich
mean time (+) or hours behind Greenwich mean time (-). The range of values is –12:00 to +13:00. If the offset isa single digit (0-9), it is formatted with a preceding 0 (01-09) with the appropriate leading sign.

:Time separator.

/

Date separator.

https://www.fast-report.com

105 / 176

Examples of use:

Format("{0:d MMM yyyy}", DateTime.Now) = "9 Aug 2009"
Format("{0:MM/dd/yyyy}", DateTime.Now) = "08/09/2009"
Format("{0:MMMM, d}", DateTime.Now) = "August, 9"Format("{0:HH:mm}", DateTime.Now) = "16:07"
Format("{0:MM/dd/yyyy hh:mm tt}", DateTime.Now) = "08/09/2009 04:07 PM"

https://www.fast-report.com

106 / 176

FormatCurrency
Function

Parameters

Return value

FormatCurrency

object value

stringFormats the specified value as a currency, using the Windows regional settings.
Example:FormatCurrency(1.25) = "$1.25"

Function

Parameters

Return value

FormatCurrency

object value,``int decimalDigits

stringFormats the specified value as a currency. The "decimalDigits" parameter indicates how many places are displayed
to the right of the decimal.
Example:FormatCurrency(1.25, 1) = "$1.3"

https://www.fast-report.com

107 / 176

FormatDateTime
Function

Parameters

Return value

FormatDateTime

DateTime value

stringFormats the specified value as a date/time, using the Windows regional settings. This function does not include
neutral values in the resulting string.
Example:FormatDateTime(#1/1/2009#) = "01/01/2009"
FormatDateTime(#1/1/2009 1:30#) = "01/01/2009 1:30:00 AM"
FormatDateTime(#1:30#) = "1:30:00 AM"

Function

Parameters

Return value

FormatDateTime

DateTime value,``string format

stringFormats the specified value as a date/time, using the named format specified in the "format" parameter. The valid
values for this parameter are:"Long Date""Short Date""Long Time""Short Time"
Example:FormatDateTime(#1/1/2009 1:30#, "Long Date") = "Thursday, January 01, 2009"
FormatDateTime(#1/1/2009#, "Short Date") = "01/01/2009"
FormatDateTime(#1:30#, "Short Time") = "01:30 AM"
FormatDateTime(#1:30#, "Long Time") = "1:30:00 AM"

https://www.fast-report.com

108 / 176

FormatNumber
Function

Parameters

Return value

FormatNumber

object value

stringFormats the specified value as a number, using the Windows regional settings.
Example:FormatNumber(1234.56) = "1,234.56"

Function

Parameters

Return value

FormatNumber

object value,``int decimalDigits

stringFormats the specified value as a number. The "decimalDigits" parameter indicates how many places are displayed
to the right of the decimal.
Example:FormatNumber(1234.56, 1) = "1,234.6"

https://www.fast-report.com

109 / 176

FormatPercent
Function

Parameters

Return value

FormatPercent

object value

stringFormats the specified value as a percent, using the Windows regional settings.
Example:FormatPercent(0.15) = "15.00%"

Function

Parameters

Return value

FormatPercent

object value,``int decimalDigits

stringFormats the specified value as a percent. The "decimalDigits" parameter indicates how many places are displayed
to the right of the decimal.
Example:FormatPercent(0.15, 0) = "15%"https://www.fast-report.com

110 / 176

Conversion
ToBoolean
Function

Parameters

Return value

ToBoolean

object value

bool

Converts the specified value to boolean.
Example:ToBoolean(1) = true
ToBoolean(0) = false

https://www.fast-report.com

111 / 176

ToByteFunction

Parameters

Return value

ToByteobject value

byte

Converts the specified value to byte.
Example:ToByte("55") = 55

https://www.fast-report.com

112 / 176

ToCharFunction

Parameters

Return value

ToCharobject value

char

Converts the specified value to char.
Example:ToChar(65) = 'A'

https://www.fast-report.com

113 / 176

ToDateTime
Function

Parameters

Return value

ToDateTime

object value

DateTime

Converts the specified value to date/time.
Example:ToDateTime("1/1/2009") = #1/1/2009#https://www.fast-report.com

114 / 176

ToDecimal
Function

Parameters

Return value

ToDecimal

object value

decimalConverts the specified value to decimal.
Example:ToDecimal(1) = 1m
ToDecimal("1") = 1m

https://www.fast-report.com

115 / 176

ToDouble
Function

Parameters

Return value

ToDouble

object value

doubleConverts the specified value to double.
Example:ToDouble(1) = 1
ToDouble("1") = 1

https://www.fast-report.com

116 / 176

ToInt32
Function

Parameters

Return value

ToInt32

object value

int

Converts the specified value to int.
Example:ToInt32(1f) = 1
ToInt32("1") = 1

https://www.fast-report.com

117 / 176

ToRoman
Function

Parameters

Return value

ToRomanobject value

stringConverts the specified numeric value to its roman representation. The value must be in range 1-3998.
Example:ToRoman(9) = "IX"

https://www.fast-report.com

118 / 176

ToSingle
Function

Parameters

Return value

ToSingle

object value

float

Converts the specified value to float.
Example:ToSingle(1m) = 1f
ToSingle("1") = 1f

https://www.fast-report.com

119 / 176

ToString
Function

Parameters

Return value

ToString

object value

stringConverts the specified value to string.
Example:ToString(false) = "False"
ToString(DateTime.Now) = "08/09/2009 4:45:00 PM"

https://www.fast-report.com

120 / 176

ToWords
Function

Parameters

Return value

ToWords

object value

stringConverts the specified currency value to words.
Example:ToWords(1024.25) = "One thousand and twenty-four dollars and 25 cents"

Function

Parameters

Return value

ToWords

object value,``string currencyName

stringConverts the specified currency value to words. The "currencyName" parameter indicates the currency. Valid values
for this parameter are:
"USD"
"EUR"
"GBP"
Example:ToWords(1024.25, "EUR") = "One thousand and twenty-four euros and 25 cents"

Function

Parameters

Return value

ToWords

object value,``string one,``string many

stringConverts the specified integer value to words. The "one" parameter contains the name in singular form; the "many"
parameter contains the name in plural form.
Example:ToWords(124, "page", "pages") = "One hundred and twenty-four pages"
ToWords(1, "page", "pages") = "One page"https://www.fast-report.com

121 / 176

ToWordsEnGb
Function

Parameters

Return value

ToWordsEnGb

object value

stringConverts the specified currency value to words in Great Britain english. There are the following differences between
this function and ToWords:
the GBP currency is used by default;
different words used when converting milliards and trilliards.
Example:ToWordsEnGb(121) = "One hundred and twenty-one pounds and 00 pence"

Function

Parameters

Return value

ToWordsEnGb

object value,``string currencyName

stringConverts the specified currency value to words in Great Britain english. The "currencyName" parameter indicatesthe currency. Valid values for this parameter are:
"USD"
"EUR"
"GBP"
Example:ToWordsEnGb(1024.25, "EUR") = "One thousand and twenty-four euros and 25 cents"

Function

Parameters

Return value

ToWordsEnGb

object value,``string one,``string many

stringConverts the specified integer value to words in Great Britain english. The "one" parameter contains the name insingular form; the "many" parameter contains the name in plural form.
Example:ToWordsEnGb(124, "page", "pages") = "One hundred and twenty-four pages"
ToWordsEnGb(1, "page", "pages") = "One page"https://www.fast-report.com

122 / 176

ToWordsRu
Function

Parameters

Return value

ToWordsRu

object value

stringConverts the specified currency value to words in russian.
Example:ToWordsRu(1024.25) = "Одна тысяча двадцать четыре рубля 25 копеек"Function

Parameters

Return value

ToWordsRu

object value,``string currencyName

stringConverts the specified currency value to words in russian. The "currencyName" parameter indicates the currency.
Valid values for this parameter are:
"RUR"
"UAH"
"USD"
"EUR"
Example:ToWordsRu(1024.25, "EUR") = "Одна тысяча двадцать четыре евро 25 евроцентов"Function

Parameters

Return value

ToWordsRu

object value,``bool male,``string one,``string two,``string many

stringConverts the specified integer value to words in russian. The "male" parameter indicates the gender of the name.
The "one", "two" and "five" parameters contain a form of the name used with "1", "2" and "5" numbers.
Example:// the "страница" word is of female gender, male = false
ToWordsRu(122, false, "страница", "страницы", "страниц") ="Сто двадцать две страницы"// the "лист" word is of male gender, male = true
ToWordsRu(122, true, "лист", "листа", "листов") ="Сто двадцать два листа"https://www.fast-report.com

123 / 176

Program Flow
ChooseFunction

Parameters

Return value

Choosedouble index,``params object[] choiceobjectReturns an element of the "choice" array with the index specified in the "index" parameter. The first array element
has 1 index.
Example:Choose(2, "one", "two", "three") = "two"https://www.fast-report.com

124 / 176

IIf
Function

Parameters

Return value

IIfbool expression,``object truePart,``object falsePart

objectReturns the "truePart" value, if the "expression" is true. Otherwise, returns the "falsePart" value.
Example:IIf(2 > 5, "true", "false") = "false"

https://www.fast-report.com

125 / 176

SwitchFunction

Parameters

Return value

Switchparams object[] expressions

object

The argument supplied to expressions consists of paired expressions and values. The Switch function evaluates the
odd-numbered expressions from lowest to highest index, and returns the even-numbered value associated with thefirst expression that evaluates to True.
Example:// returns one of the following values - "а greater than 0",// "а less than 0", "а equals to 0", depending on "a" value
Switch(a > 0, "а greater than 0",
a < 0, "а less than 0",a == 0, "а equals to 0")

https://www.fast-report.com

126 / 176

Totals
In many reports, we may need to show some total information: sum of the group, number of rows in the list, andmany others. FastReport uses totals to perform this task. For the total, you need to indicate the following
parameters:
The total function type;The expression, which is supposed to be calculated. For the "Count" function, you do not need to indicate theexpression;
The condition. The function will be calculated if the condition is met. It's not obligatory to set up the condition.
The data band, for which the function will be processed;
The band, in which the total value will be printed.
The list of total functions is given below:
Function

Description

Sum

Calculates the sum of the expression.

Min

Calculates the minimum value of the expression.

Max

Calculates the maximum value of the expression.

AverageCalculates the average value of the expression.

Count

Returns the number of rows.

To add Total, you should open the window "Data". Click on the green icon with a plus sign in front of Totals node:

After that, set the above parameters in the "Properties" window. Then, drag the added Total to the report page. To
remove added Total, use the red icon with a minus sign.

https://www.fast-report.com

127 / 176

Report parameters
You can define parameters in a report. Parameter is a variable, the value of which can be defined both in a report
itself and outside of it (a program, calling a report can transfer parameters values into it. See details in"Programmer's manual"). A parameter can be used in expressions and be displayed in report objects like the "Text"
object.
Most common methods of using parameters:
data filtering by condition set in a parameter;
printing parameter value in a report.
A parameter has the following properties:
Property

Description

Name

Parameter's name can have any symbols except dot ".".

DataType

Parameter data type.

Expression

Expression which returns parameter's value. More details about expressions can be found in the "Expression"
chapter. This expression will be processed when calling a parameter.

Value

Parameter value. This property is not available in the designer and can be filled programmatically.

You have to set up "Name" and "DataType" properties. The "Expression" property can be left empty. In this caseparameter's value should be passed programmatically.
To add a parameter, you should open the window "Data". Click on the green icon with a plus sign in front of
Parameters node. After that, set the above parameters in the "Properties" window. Now, you can drag a parameterto the desired location on the report page, or use it to filter the data.

To remove a parameter, use the red icon with a minus sign.

https://www.fast-report.com

128 / 176

Expressions
In many places in FastReport, expressions are used. For example, the "Text" object can contain expressions insquare brackets.
An expression is a code in C# or VB.Net language, which returns any value. For example:

2 + 2

An expression should be written in a language chosen as a script in a report. By default, it is C#.

https://www.fast-report.com

129 / 176

Expression editor
For the convenience of writing expressions use the Expression Editor. It can be opened by double clicking on the
text object or by using the buttonin the properties.

The expression editor is a window in which you can enter text expression or insert the items from the "Data"
window:https://www.fast-report.com

130 / 176

Reference to report objects
For referring to report objects, use the object's name. The following example will return the height of the Text1
object:Text1.Height

For referring to report properties, use Report variable. The following example returns file name from which a report
was loaded.

Report.FileName

Besides, you can refer to nested object properties. The following example will return a report name:

Report.ReportInfo.Name

https://www.fast-report.com

131 / 176

Using .Net functions
You can use any.Net objects in expressions. The following example demonstrates Max function use:

Math.Max(5, 10)

By default a report uses the following .Net assemblies:

System.dll
System.Drawing.dll
System.Windows.Forms.dll
System.Data.dll
System.Xml.dll

You have access to all .Net objects declared in these assemblies. If you need to have access to another assembly,
add its name in report assemblies list (it can be done in the desktop version of FastReport designer).
For example, if you want to use a function in your report which was declared in your application, add applicationassembly (.exe or .dll) in a report assemblies list. After that you can call the function by using namespace of yourapplication. For example, if the following function is defined in application:namespace Demo{public static class MyFunctions{
public static string Func1(){
return "Hello!";}}}

You can use it in your report in the following way:

Demo.MyFunctions.Func1()

If you add the "using Demo" line at the top of the report's script, it will allows you to shorten the syntax:

MyFunctions.Func1()

To refer to the function or variable that was defined in a script, just use its name:

myPrivateVariableThatIHaveDeclaredInScript
MyScriptFunction()

https://www.fast-report.com

132 / 176

You can use in an expression only those functions which return a value.

https://www.fast-report.com

133 / 176

Reference to data elements
Apart from standard language elements, you can use the following report elements in expressions:data source columns;
system variables;
total values;
report parameters.
All these elements are contained in the "Data" window. Any of these elements can be used in an expression, by
including it in square brackets. For example:[Page] + 1

This expression returns next printed page number. A system variable "Page", which returns current report page
number, is used in the expression. It is enclosed in square brackets.

https://www.fast-report.com

134 / 176

Reference to data sources
For reference to data source columns, the following format is used:[DataSource.Column]

Source name is separated from column name by a period, for example:[Employees.FirstName]

Source name can be compound in case, if we refer to a data source by using a relation. See more details in the"Data" section. For example, this is how you can refer to a related data source column:[Products.Categories.CategoryName]

Let us look at the following example of using columns in an expression:[Employees.FirstName] + " " + [Employees.LastName]

Here it should be noted that: every column has a definite data type, which is set in the "DataType" property (you cansee it in the "Properties" window if to choose data column in the "Data" window beforehand). How a column can beused in an expression depends on its type. For instance, in above mentioned example, both columns - first nameand last name - have got a string type and that is why they can be used in such a way. In the following example, wewill try to use "Employees.Age" column of numeric type, which will lead to an error:[Employees.FirstName] + " " + [Employees.Age]

The error occurs because, you never mix strings with numbers. For this, you need to convert the number into astring:[Employees.FirstName] + " " + [Employees.Age].ToString()

In this case, we refer to the "Employees.Age" column as if it is an integer variable. And it is so. We know that all
expressions are compiled. All non-standard things (like referring to data columns) from a compiler's point of vieware converted into another type, which is understandable to a compiler. So, the last expression will be turned into
the following form:(string)(Report.GetColumnValue("Employees.FirstName")) + " " +(int)(Report.GetColumnValue("Employees.Age")).ToString()

https://www.fast-report.com

135 / 176

As seen, FastReport changes reference to data columns in the following way:
[Employees.FirstName][Employees.Age]--> (string)(Report.GetColumnValue("Employees.FirstName"))--> (int)(Report.GetColumnValue("Employees.Age"))That is, we can use data column in an expressions as if it is a variable having a definite type. For example, thefollowing expression will return the first symbol of an employee's name:[Employees.FirstName].Substring(0, 1)

https://www.fast-report.com

136 / 176

Reference to system variables
You can use the following system variables in expressions (they are accessible in the "Data" window):

Variable.Net data
type

Description

Date

DateTime

Date and time of the report's start.

Page

int

Current page number.

TotalPages

int

Total number of pages in the report. To use this variable, you need to enable
the report's double pass. You can do this in "Report

PageN

stringPage number in the form: "Page N".

PageNofM

stringPage number in the form: "Page N of M".

Row#

int

Data row number inside the group. This value is reset at the start of a newgroup.

AbsRow#int

Absolute number of data row. This value is never reset at the start of a newgroup.

Properties..."menu.

Every variable has a data type. And on this, depends how it will be used in the expression. Here is an example of an
expression where date is being used:[Date].Year

This expression returns the current year. As "Date" variable has DateTime type, so we can refer to its "Year"property. We can get the current month similarly ([Date].Month).
FastReport converts reference to system variable into the following form (for example, the "Date" variable):((DateTime)Report.GetVariableValue("Date"))https://www.fast-report.com

137 / 176

Reference to Total values
In order to refer to a total value, use its name:[TotalSales]

FastReport converts reference to totals into the following form:

Report.GetTotalValue("TotalSales")As you can see, the data type is not used here. It is so, because the total value is of FastReport.Variant type. It can beused directly in any expressions because it is automatically converted to any type. For example:[TotalSales] * 0.2f

https://www.fast-report.com

138 / 176

Reference to report parameters
In order to refer to report parameters, you should use its name:[Parameter1]

Parameters can be nested. In this case, you should use both parent and child parameter names in the following
form:[ParentParameter.ChildParameter]

Parameters have a definite data type. It is set in the "DataType" property of the parameter. The way it can be used in
an expression depends on parameter's data type.
FastReport converts reference to a report parameter into the following way:((string)Report.GetParameterValue("Parameter1"))

https://www.fast-report.com

139 / 176

Script
Script is a higher-level programming language, which is part of the report. Script can be written in one of thefollowing .Net languages:
C#
VisualBasic.Net
A script is applicable in many places. Using the script, you can do the following:
perform data handling, which cannot be done via regular means of the FastReport engine;
control the printing of report pages and bands on the page;
control the interaction between elements on dialogue forms;
control the formation of dynamic "Table" objects;
and many more.
In order to see the report's script, switch to the "Script" tab in the designer:

In the figure you can see the "Events" window for the object Page1. This window allows you to create event
handlers for components and bands.
In the script, you can:add your variables, methods and properties to the main script class;create a report object's events handler;
add new classes to the script, if needed. A class can be added either before the ReportScript main class orafter it.
You cannot:
delete, rename or change the visibility area of the ReportScript main class;rename a namespace in which the main class is located.
When the report is running, the following occurs:
FastReport adds into the script a list of variables, whose names correspond with the names of the report
objects. This is done before compiling the script and allows you to refer to the report objects by their names;
an expression handler is added to the script, which handles all expressions found in the report;a script is compiled, if it is not empty;

https://www.fast-report.com

140 / 176

the script class is initialized;
the report is run.

https://www.fast-report.com

141 / 176

Events
In order to control the report with maximum flexibility, every report object has got several events. For example, in a
handler, connected to the "Data" band, you can filter records, that is, hide or show the band depending on certain
conditions.
To add an event, select the report object and open the "Event" window. Select the handler and click on the icon
. To delete an added event handler, delete the name in the "Event" window and the code of the handler in the"Script" tab.
The "Report" object has got events as well. This object can be chosen by the following method:
select "Report" in the "Report Tree" window;
select "Report" in the drop-down list in the "Properties" window.
Let us consider the events which are fired during the report generation process. As an example, we will take asimple report, containing one page, one "Data" band and two "Text" objects on the band:In the beginning of the report, the "Report" object fires the StartReport event. Before formation of the report page,
the StartPage event is fired. This event is fired once for every template page (do not confuse with prepared report
page!). In our case, regardless of how many pages were in the prepared report - event is fired once, since thetemplate report has got one page.
Further, printing of the "Data" band row starts. This happens in the following way:
1. the BeforePrint band event is fired;
2. the BeforePrint event of all objects lying on the band is fired;
3. all objects are filled with data;
4. the AfterData event of all objects lying on the band is fired;
5. the BeforeLayout band event is fired;
6. objects are placed on the band, the height of the band is calculated and band is stretched (if it can);7. the AfterLayout band event is fired;
8. if the band cannot fit on a free space on the page, a new page is formed;
9. the band and all its objects are displayed on a prepared report page;
10. the AfterPrint band event is fired;
11. the AfterPrint event of all the band objects is fired.
Printing of the band row occurs as long as there is data in the source. After this, the formation of the report in ourcase ends. The FinishPage event of a page is fired and finally - the FinishReport event of the "Report" object.
So, by using events of different objects, you can control every step of report formation. The key to correct use of
events - full understanding of the band printing process, expound in the eleven steps above. So, a lot of operations
can be done, by using only the BeforePrint band - any change, done to the object, will also be displayed. But in thisevent, it is not possible to analyze, on which page will the band be printed, if it stretches, because the height of theband will be calculated on step 6. This can be done with the help of the AfterLayout event in step 7 or AfterPrint instep 10, but in the latter case, the band is already printed and operations with objects do not give out anything. In
one word, you must clearly state, at what moment each event is fired and use, those, which correspond with thegiven task.

https://www.fast-report.com

142 / 176

Reference to report objects
For referring to report objects (for example, "Text" object) use the name of the object. The following example
returns the height of Text1 object:float height = Text1.Height;

Note that report's native unit of measurement is screen pixels. Keep it in mind when using such object's properties
like Left, Top, Width, and Height. To convert pixels into centimeters and back, use the constants, defined in the"Units" class:float heightInPixels = Text1.Height;
float heightInCM = heightInPixels / Units.Centimeters;
Text1.Height = Units.Centimeters * 5; // 5см

https://www.fast-report.com

143 / 176

Engine and Report objects
Apart from objects, which are contained in the report, there are two variables defined in the script: Report andEngine.
The Report variable refers to the current report. In the list below, a list of the report object's methods is given:
Methodobject Calc(``
expression)

Description
stringCalculates an expression and returns the value. When calling this method the first time,
an expression gets compiled, which needs some time.

object GetColumnValue(``string complexName)

Returns the value of the data column. The name must be presented in the"DataSource.Column" form. If the column has got the null value, it is converted into avalue by default (0, empty string, false).

object
GetColumnValueNullable(``string complexName)

Returns the value of the data column. Contrary to the previous method, it does not get
converted into a default value and may be null.

Parameter GetParameter(``string complexName)

Returns the reports parameter with the indicated name. Name can be compounded
when referring to the nested parameter: "MainParam.NestedParam".

objectGetParameterValue(``string complexName)

Returns the value of the report parameter with the indicated name.

void SetParameterValue(``string complexName, ``object value)

Sets the value of the report parameter with the indicated name.

object GetVariableValue(``string complexName)

Returns the value of the system variable, for example, "Date".

object GetTotalValue(``string name)Returns the value of the total, defined in the "Data" window, by its name.

DataSourceBase
GetDataSource(``alias)

Returns the data source, defined in the report, by its name.
string

The Engine object is an engine that controls the report creation. By using the methods and properties of the engine,
you can manage the process of placing bands onto the page. You can use the following properties of the Engine
object:Property

Description

float CurX

Current coordinates on the X-axis. This property can be assigned a value, so as to shift the printed
object.

float CurY

Current printing position on the Y-axis. To this property, a value can be assigned so as to shift theprinted object.

int CurColumn

Number of the current column in a multicolumn report. The first column has the number 0.

https://www.fast-report.com

144 / 176

Property

Description

int CurPage

Number of the page being printed. This value can be received from the "Page" system variable.

float PageWidth

Width of the page minus the size of the left and right margins.

float PageHeight

Height of the page minus the size of the top and bottom margins.

float
PageFooterHeight

Height of the page footer (and all its child bands).

float
ColumnFooterHeight

Height of the column footer (and all of its child bands).

float FreeSpace

Size of the free space on the page.

bool FirstPass

Returns true, if the first (or only) report pass is being executed. Number of passes can be obtained
from the Report.DoublePass property.

bool FinalPass

Returns true, if the last (or only) report pass is being executed.

On the figure below, you can see the meaning of some properties listed above.

Engine.PageWidth and Engine.PageHeight properties determine the size of the printing area, which is almost
always less than the actual size of the page. Size of the printed area is determined by the page margins, which is
given by the LeftMargin, TopMargin, RightMargin and BottomMargin page properties.
Engine.FreeSpace property determines the height of the free space on the page. If there is the "Page footer" bandon the page, its height is considered when calculating the FreeSpace. Note that, after printing a band, free space isreduced.
How does the formation of a prepared report page take place? FastReport engine displays bands on the page until
there is enough space for band output. When there is no free space, the "Report footer" band is printed and a new
empty page is formed. Displaying a band starts from the current position, which is determined by the X and Y
coordinates. This position is retuned by the Engine.CurX and Engine.CurY properties. After printing a band, CurY
automatically increases by the height of the printed band. After forming a new page, the position of the CurY is set
to 0. The position of the CurX changes when printing a multicolumn report.
Engine.CurX and Engine.CurY properties are accessible not only for reading, but also for writing. This means thatyou can shift a band manually by using one of the suitable events. Examples of using these properties can be seenin the "Examples" section.

https://www.fast-report.com

145 / 176

When working with properties, which return the size or position, remember that, these properties aremeasured in the screen pixels.
In the Engine object, the following methods are defined:
MethodDescription

void AddOutline(string text)

Adds an element into the report outline and sets the current position to the added
element.

void OutlineRoot()

Sets the current position on the root of the outline.

void OutlineUp()

Shifts the current position to a higher-level outline element.

void AddBookmark(string name)Adds a bookmark.

int GetBookmarkPage(string
name)Returns the page number on which the bookmark with the indicated name is placed.

void StartNewPage()Starts a new page. If the report is multicolumn, a new column is started.

By using the AddOutline, OutlineRoot, OutlineUp methods, you can form the report outline manually. Usually, thisis done automatically with the help of the OutlineExpression property, which every band and report page have got.
The AddOutline method adds a child element to the current outline element, and makes it current. The current
report page and the current position on the page are associated with the new element. If you call the AddOutline
method several times, then you will have the following structure:

Item1
Item2
Item3

For controlling the current element, there are OutlineUp and OutlineRoot methods. The first method moves thepointer to the element, located on a higher level. So, the script

Engine.AddOutline("Item1");
Engine.AddOutline("Item2");
Engine.AddOutline("Item3");
Engine.OutlineUp();Engine.AddOutline("Item4");

will create the following outline:

Item1
Item2
Item3
Item4

The OutlineRoot method moves the current element to the root of the outline. For example, the following script:

https://www.fast-report.com

146 / 176

Engine.AddOutline("Item1");
Engine.AddOutline("Item2");
Engine.AddOutline("Item3");
Engine.OutlineRoot();
Engine.AddOutline("Item4");

will create the following outline:

Item1
Item2
Item3
Item4

For working with bookmarks, the AddBookmark and GetBookmarkPage methods of the Engine object are used.
Usually bookmarks are added automatically when using the Bookmark property, which all objects of the report
have got.
By using the Add Bookmark method, you can add a bookmark programmatically. This method creates a bookmarkon the current page at the current printing position.
The GetBookmarkPage method returns the page number on which the bookmark is placed. This method is often
used when creating the table of contents, for displaying page numbers. In this case, the report must have a double
pass.

https://www.fast-report.com

147 / 176

Reference to data sources
Contrary to the FastReport expressions (covered in the "Expressions" section), never use square brackets in script
for referring to the data sources. Instead of this, use the GetColumnValue method of the Report object, which
returns the value of the column:

string productName = (string)Report.GetColumnValue("Products.Name");As seen, you need to indicate the name of the source and its column. The name of the source can be compound incase, if we are referring to the data source by using a relation. For example, you can refer to a column of the related
data source in this way:string categoryName = (string)Report.GetColumnValue("Products.Categories.CategoryName");For making the work easier, use the "Data" window. From it you can drag data elements into the script, during thisFastReport automatically creates a code for referring to the element.
For referring to the data source itself, use the GetDataSource method of the Report object:

DataSourceBase ds = Report.GetDataSource("Products");

Help on properties and methods of the DataSourceBase class can be received from the FastReport.Net Class
Reference help system. As a rule, this object is used in the script in the following way:// get a reference to the data source
DataSourceBase ds = Report.GetDataSource("Products");// initialize it
ds.Init();// enum all rows
while (ds.HasMoreRows){// get the data column value from the current row
string productName = (string)Report.GetColumnValue("Products.Name");// do something with it...
// ...
// go next data row
ds.Next();}

https://www.fast-report.com

148 / 176

Reference to system variables
For reference to system variables, use the GetVariableValue method of the Report object:

DateTime date = (DateTime)Report.GetVariableValue("Date");A list of system variables can be seen in the "Data" window. From it, you can drag a variable into a script, during
this FastReport automatically creates a code for referring to the variable.

https://www.fast-report.com

149 / 176

Reference to Total values
For reference to the total value, use the GetTotalValue method of the Report object:float sales = Report.GetTotalValue("TotalSales");

A list of totals can be seen in the "Data" window. From it, you can drag a total into the script, during this FastReport
automatically creates a code for referring to the total.
Total value has got the FastReport.Variant type. It can be used directly in any expression, because the
FastReport.Variant type is automatically converted to any type. For example:

float tax = Report.GetTotalValue("TotalSales") * 0.2f;

Reference to the total value can be done at that time when, it is being processed. Usually the total is "ready to use"at the moment of printing the band, on which it is located in the report.

https://www.fast-report.com

150 / 176

Reference to report parameters
For referring to report parameters, use the GetParameterValue method of the Report object:int myParam = (int)Report.GetParameterValue("MyParameter");Parameters can be nested. In this case, indicate the name of the parent parameter and after the period, the name of
the child parameter:

Report.GetParameterValue("ParentParameter.ChildParameter")Parameters have got a definite data type. It is given in the DataType property of the parameter. You must take this
into account when referring to parameters. You can see a list of parameters in the "Data" window. From it, you candrag parameters into the script, during this FastReport automatically creates a code for referring to the parameters.
For changing the value of the parameter, use the SetParameterValue method of the report object:

Report.SetParameterValue("MyParameter", 10);

https://www.fast-report.com

151 / 176

Dialogue forms
Apart from an ordinary page, a report can contain one or several dialogue forms. Such dialogue form will be shown
when the report is started. In the dialogue, you can enter any type of information, needed for creating a report.
Also, a dialogue may be used to filter data, which is shown in the report.
For adding a dialogue into a report, press thefollows:

icon on the toolbar in the tab “Report”. A new dialogue looks as

To delete the dialogue, select the tab with dialogue form and press theon the "Report" toolbar.

A report, having one or several dialogues, works like this:when started, the report shows the first dialogue;
if the dialogue is closed with the help of the "ОК" button, then the next dialogue is shown; otherwise, thereport stops working;after all the dialogues have been shown, the report is built.

https://www.fast-report.com

152 / 176

Controls
On a dialogue from, the following controls can be used:
Icon

Name

Description

ButtonControl

Represents a Windows button control.

CheckBoxControl

Represents a Windows CheckBox.

CheckedListBoxControl

Displays a ListBox in which a check box is displayed to the left of each item.

ComboBoxControl

Represents a Windows combo box control.

DateTimePickerControl

Represents a Windows control that allows the user to select a date and a time and to
display the date and time with a specified format.

LabelControl

Represents a standard Windows label.

ListBoxControl

Represents a Windows control to display a list of items.

MonthCalendarControl

Represents a Windows control that enables the user to select a date using a visualmonthly calendar display.

RadioButtonControl

Enables the user to select a single option from a group of choices when paired with otherRadioButton controls.

TextBoxControl

Represents a Windows text box control.

All controls are a full analog of the standard Windows.Forms controls. The name of the element has got a Control
suffix, in order to avoid duplicate names. So, the FastReport's ButtonControl corresponds with the standard Button
control. Referencing to a control can be done by using its name:

TextBoxControl1.Text = "my text";

In fact, the FastReport's control is just a wrapper for the standard .Net control. It wraps many, but not all, propertiesof the standard control. If you need some property that is not implemented by the FastReport control, you may
access a wrapped standard control in the following way:using the "Control" property, which is of System.Windows.Forms.Control type:(TextBox1.Control as TextBox).ShortcutsEnabled = false;using the property which has the same name as the control itself, but without the "Control" suffix. For

https://www.fast-report.com

153 / 176

example, the TextBoxControl has got the "TextBox" property, which is of System.Windows.Forms.TextBox typeand returns the wrapped TextBox control:

TextBox1.TextBox.ShortcutsEnabled = false;

Help on properties and methods of the controls can be accessed from the MSDN.

https://www.fast-report.com

154 / 176

Data filtering
Dialogs can be used to filter the data which is printed in a report. For example, you have a report, which prints a listof all the employees. By using a dialog, you can choose one or several from it, and then when building the report,
the data is filtered so that only the chosen employees can be shown.
For using the data filtering, it is necessary that the initial report contains all the data. The name "filtering" itself,
assumes that, unnecessary data will not be printed when building the report.
The simplest method for organizing data filtering is to use the Filter property on the "Data" band. In the band
editor, you can indicate the filter expression, for example:

By using the dialogue, you can ask a value from a user, and use it in the filtering expression.
This method can be used, if a simple value is needed. If the task is to display a list of values and inquire one orseveral from it, implementing this becomes difficult. You may think that, it is a simple task - showing a list of
employees in the ListBoxControl control element and choosing one or several values. For implementing this, youneed to use the script, which does the following:
get the data source by its name;initialize data;
fill the ListBoxControl with the data from data source;
after choosing the employee, build a filter expression that will be used in the "Data" band.
FastReport can do this automatically. For this, automatic filtering is used, which we will observe now.

https://www.fast-report.com

155 / 176

Automating filtering
Control is connected to the data column using the "DataColumn" property. If the control can display a list of values(for example, ListBoxControl), it fills with values from the indicated data column. This happens automatically when
the dialogue is shown. Further, the user works with the dialogue, selects one or several items in the control andcloses the dialogue. At this time, the data source which was indicated in the "DataColumn" property is filteredautomatically.
The advantage of this method is that, you can use it in any report without writing any code.
Automatic filtering is supported by the following controls:
Icon

Name
CheckBoxControl

CheckedListBoxControl

ComboBoxControl

DateTimePickerControl

ListBoxControl

MonthCalendarControl

RadioButtonControl

TextBoxControl

https://www.fast-report.com

156 / 176

Filter operations
By default FastReport filters the data rows, which contain the value, equal to the value of the control. This behavior
is defined in the "FilterOperation" property of the control. You can use the following operations:Operation

Equivalent

EffectEqual=

Filter the value if it is equal to the control's value.

NotEqual<>

Filter the value if it is not equal to the control's value.

LessThan<Filter the value if it is less than the control's value.

LessThanOrEqual<=

Filter the value if it is less than or equal to the control's value.

GreaterThan>

Filter the value if it is greater than the control's value.

GreaterThanOrEqual>=

Filter the value if it is greater than or equal to the control's value.

For example, if the "FilterOperation" property of the control is set to "LessThanOrEqual" and you enter the value 5in the control, then all the data rows will be chosen, for which the corresponding column value is less than or equal
to 5.
For the data of "string" type, you can use extra operations:Operation

EffectContains

Filter the value if it contains the control's value.

NotContains

Filter the value if it does not contain the control's value.

StartsWith

Filter the value if it starts with the control's value.

NotStartsWith

Filter the value if it does not start with the control's value.

EndsWith

Filter the value if it ends with the control's value.

NotEndsWith

Filter the value if it does not end with the control's value.

For example, if the "FilterOperation" property of the control is set to "StartsWith" and you enter the "A", then, alldata rows whose corresponding data column's value starts with "A", will be chosen.

https://www.fast-report.com

157 / 176

Filtering on data range
This method of filtering is comfortable for using when working with values, having a quantitative characteristic, forexample, the cost. You can filter goods, having the cost less than or more than the given. In order to indicate, how
to interpret the value entered in the element, use the "FilterOperation" property, looked at above.
Using two controls, which are connected to the same data column and have got different settings of the"FilterOperation" property, you can indicate the beginning and the ending of the data range. For the first control,
you need to indicate the FilterOperation = GreaterThanOrEqual, for the second - LessThanOrEqual.

https://www.fast-report.com

158 / 176

Filtering on related data column
As we know, between two data sources, a relation can be set. With the help of relation, it is possible to filter data inthe source, by using a data column from a different source.
Assuming, you have placed on the dialogue a ListBoxControl and indicated the following data column in the"DataColumn" property:

Products.Categories.CategoryName

How will filtering work?
when filling the control with values, the "CategoryName" column from the "Categories" data source will be
used;
the filter will be applied to the "Products" table. Those data rows will be filtered for which the following
condition is correct:

the [Products.Categories.CategoryName] contains one of the values, selected by the user

https://www.fast-report.com

159 / 176

Filtering with cascading lists
A cascading list is a list with choices that change based on the value a user selects in another list. For example, youhave two lists on a form - one with categories, another one with products. When you choose a category in the first
list, you will see in the second list the products in a chosen category.

To create a cascading list, you need to use two data sources with master-detail relation between them. Attach themaster list to a column in the master data source; attach the detail list to a column in the detail data source. Also set
the master list's "DetailControl" property to the detail list.

https://www.fast-report.com

160 / 176

Controlling the filtering from the code
Even if automatic filtering is enough for many cases, you have the possibility of managing it manually. For this, thefollowing methods and properties are used.
The "AutoFill" property controls the filling of controls with data. It is used by controls, which can show a list ofvalues, for example, the ListBoxControl. Before showing a dialogue, FastReport fills such controls with data. Bydefault, the property is set to true. If it is disabled, the control will not be filled, and you must do it yourself, bycalling the "FillData" method:

ListBox1.FillData();

The "AutoFilter" property controls the data filtering. It is used by all controls. After the dialogue has been closed bythe "ОК" button, FastReport applies data filter automatically. By default, the property is set to true. If it is disabled,
the filtering will not happen, and you must do it yourself, by calling the "FilterData" method:

ListBox1.FilterData();https://www.fast-report.com

161 / 176

ExportRendered report can be saved in one of formats: a file prepared report (fpx), Adobe Acrobat (PDF), Microsoft Word
2007, Excel 2007, PowerPoint 2007, TXT, RTF, Microsoft XPS, OpenOffice Calc, OpenOffice Writer, MHT, HTML,
Excel, XML, DBF table, CSV.
To select the export format, run the report in preview mode, hover the mouse pointer over the floppy icon, andselect one of the formats in the drop-down list:

After that, the standard Windows file saving dialogue will be shown.
Also, you can print a report in preview mode. To do this, click on the printer icon in the toolbar. This opens thestandard Windows printing dialogue.

https://www.fast-report.com

162 / 176

Saving in FPX format
FPX format is FastReport's "native" format. The advantages of this format are as follows:saving the report without losing the quality. Opening an already saved file, you can do all operations with it,
like print, export, editing;compact format based on XML, compressed with the help of ZIP;
when needed, the report file can be unpacked by any archiver that supports the ZIP-format and correctedmanually in any text editor.
The only thing lacking with the format is that, to view it, you need to have FastReport.Net.
In order to save in the FPX format, press the "Save" button in the preview window and choose the "Preparedreport" file type.

https://www.fast-report.com

163 / 176

Export to Adobe Acrobat (PDF)
PDF (Portable Document Format) is a platform-independent format of electronic documents created by Adobe
Systems. The free Acrobat Reader package is used for viewing. This format is rather flexible – it allows the inclusionof necessary fonts, vector and bitmap images; it allows transferring and storage of documents intended for viewing
and further printing.
Export method is a layered one.

https://www.fast-report.com

164 / 176

Export to Excel 2007
MS Excel 2007, is an application for working with spreadsheets included in Microsoft Office 2007.
Export method: tabular.

https://www.fast-report.com

165 / 176

Export to Microsoft Word 2007(DOCX)A Microsoft Word 2007 - the text editor included in the package of the programs Microsoft Office 2007.
Export method: tabular.

https://www.fast-report.com

166 / 176

Export to PowerPoint 2007
PowerPoint 2007 is an application for working with electronic presentations. It is included into Microsoft Office
2007.
Export method is a layered one.

https://www.fast-report.com

167 / 176

Export to TXT
TXT is a regular text file that can be opened in any text editor, or printed to a dot-matrix printer.
Export method: tabular.

https://www.fast-report.com

168 / 176

Export to RTF
RTF (Rich Text Format) was developed by Microsoft as a standard format for exchanging text information. At the
moment RTF-documents are compatible with many new text editors and operation systems.
Export method: tabular.

https://www.fast-report.com

169 / 176

Export to Microsoft XPS
XPS format is a graphics format fixed layout data based on XML. XPS file is similar to a file in PDF, but to describe
the layout and metadata uses XML instead of PostScript. The advantage is a smaller file size compared to PDF.
Export method is a layered one.

https://www.fast-report.com

170 / 176

Export to OpenOffice Calc
OpenDocument Format (ODF, OASIS Open Document Format for Office Application) was designed by OASIS andbased on XML format used in OpenOffice.
FastReport supports export to table (.ods file). These files can be opened in OpenOffice.
Export method: tabular.

https://www.fast-report.com

171 / 176

Export to OpenOffice Writer
OpenOffice Writer is a text processor open source from the OpenOffice Suite. Similar to Microsoft Office Word
format. Has its own file format .odt.
The export method: tabular.

https://www.fast-report.com

172 / 176

Export to MHT (web archive)
MHT, short for MIME HTML, is a web page archive format used to bind resources which are typically represented byexternal links (such as images, Flash animations, Java applets, audio files) together with HTML code into a single
file. The content of an MHT file is encoded as if it were an HTML e-mail message, using the MIME typemultipart/related.
Export method: tabular.

https://www.fast-report.com

173 / 176

Export to Excel (XML)
Excel is an application for working with electronic worksheets. It is included into Microsoft Office.
Export method: tabular.

https://www.fast-report.com

174 / 176

Export to DBF
The DBF format is designed for storing and transferring data. It is a standard way to store data in some DBMS. Also,
supports a variety of tabular editors, such as Microsoft Excel.
The export method: tabular.

https://www.fast-report.com

175 / 176

Export to CSV
The CSV file is used for the digital storage of data structured in a table of lists form. Each line in the CSV filecorresponds to a row in the table. Within a line, fields are separated by commas, each field belonging to one table
column. CSV files are often used for moving tabular data between two different computer programs, for example
between a database program and a spreadsheet program.
Export method: tabular.

https://www.fast-report.com

176 / 176