How to display tag values in custom reports of type FastReport

August 26, 2019 | Reliance SCADA

The Reliance SCADA/HMI system's custom reports are intended to create documents that can be displayed, printed, or saved to a file. This article is a simple introduction to custom reports. You will learn how to use them in a visualization project (available for download here).



1. Project description

Open the project. The four Display components in the visualization window are important as they allow displaying and editing tag values (pressure, level, pump status, door status).


Uživatelské proměnné, Reliance SCADA


In the Device Manager, the Level tag's Eng. units property is set. For the Pump tag's values (pump status), a state list of the same name is defined. It is a list of integer values. The value 0 corresponds to “off”, the value 1 to “on”, and the value 2 to “alert”. The Door tag (door status) is of type Bool. The display of the tag's value is specified by the properties Text for state 'Logical 1' and Text for state 'Logical 0'.



2. Creating a custom report and adding items to it

Open the Custom Report Manager. In the toolbar, click on New Report.


Správce uživatelských sestav, Reliance SCADA


This brings up the Select Custom Report Type dialog. Select FastReport.


Výběr typu uživatelské sestavy, Reliance SCADA


On the right side of the manager (Basic), change the report's name (e.g., to Report).


Then, click on Add Report Items in the manager's toolbar,


Správce uživatelských sestav, Reliance SCADA


which will bring up the Select Tag dialog. Select all tags.


Výběr proměnné, Reliance SCADA


Confirm adding new report items to the custom report by clicking OK and close the dialog.


Výběr proměnné, Reliance SCADA


3. Defining the display of tag values for report items

The Custom Report Manager allows you – for report items – to specify the way tag values are displayed. On the Basic page, you must configure the Test value property. This property specifies the value of a tag at design-time.


The Level item – activate the Show eng. units option and set the test value to 1.23.

The Pressure item – set the test value to 0.65.

The Door item – set the test value to 1.

The Pump item – set the Value format property to Based on tag and the test value to 1.


After that, save the changes by clicking on Save All.


Správce uživatelských sestav, Reliance SCADA


4. Starting the FastReport Designer

Now, in the Custom Report Manager, you'll be customizing the custom report template. Go to the toolbar and click on Edit Report, which will open the FastReport Designer.


Správce uživatelských sestav, Reliance SCADA


Návrhář sestav FastReport, Reliance SCADA


5. Defining variables that display text strings used in the Reliance project

In the designer, define variables that will be used to display the Reliance project's text strings. Go to the toolbar and click on Variables.


Návrhář sestav FastReport, Reliance SCADA


In the Edit Variables editor, choose the Category command in the toolbar to add a new category of variables. Select this category. In the editor's toolbar, click on Edit, which will allow changing the category name. The new name should be, for example, Reliance String Manager.


Upravit proměnné, Reliance SCADA


Next, click on Add String from Project.


Upravit proměnné, Reliance SCADA


This brings up the Select String dialog. Once you're in, press Ctrl and select the following strings: Values, Level, Pressure, Pump, Door, open, closed. Confirm the selection by clicking OK.


Vybrat text, Reliance SCADA


In the Edit Variables editor's toolbar, save the changes by choosing the OK command. Then, close the editor.


Upravit proměnné, Reliance SCADA


6. Defining a report page

In the designer, define the appearance of Page1. In the Data Tree window on the right side of the designer, switch to the Variables tab. There are three categories here:


1. Reliance String Manager

In this category, there are variables that contain text strings defined within the Reliance project.


2. Reliance Custom Report

Here you will find variables containing custom report items.


3. System variables

This category contains FastReport's system variables.


On Page1, you can use a drag-and-drop operation to create text objects for the variables available in the Data Tree window. These objects will display the variables' values. In the Reliance String Manager category, select Values#9. On Page1, perform a drag-and-drop operation to create a new text object. In the same way – below the text [Values#9] –, create other text objects from the variables Pressure#11, Level#12, Door#14, and Pump#13. To the right of these objects, create text objects from the variables Pressure$3, Level$2, Door$1, and Pump$4.


Návrhář sestav FastReport, Reliance SCADA


7. Configuring the format of pressure values

For the mvPressure2 object, which displays pressure values, configure the value format. Pressure values will be displayed to two decimal places. On Page1, open the Text – Properties dialog by double-clicking on [Pressure$3]. On the Format page, set the category to Number and select the format 1234.50. Once the format is selected, the Format string property is automatically set to %2.2f. Click OK to save the changes and close the dialog.


Text – parametry, Reliance SCADA


8. Configuring the format of door status values

For the mvDoor2 object, which displays door status, configure the value format. On Page1, open the Text – Properties dialog by double-clicking on [Door$1]. On the Format page, set the category to Boolean and select the format False,True. Once the format is selected, the Format string property is automatically set to False,True. Change the value of this property to open,closed. Click OK to save the changes and close the dialog.


Text – parametry, Reliance SCADA


The door status value will be formatted using text strings defined within the Reliance project. Use a simple script to configure the mvDoor2 object's Format string property:


mvDoor2.DisplayFormat.FormatStr = <open#5> + "," + <closed#6>


Návrhář sestav FastReport, Reliance SCADA


9. Displaying the custom report

The report can be displayed directly from the manager by choosing the Show Report command. There's no need to run the visualization project.


Správce uživatelských sestav, Reliance SCADA


The report will be displaying test values. The project's text strings will be in English.


Report, Reliance SCADA


Click the Close button in the toolbar to close the report.


Report, Reliance SCADA


Close the Custom Report Manager.


If you choose the en_US command in the Information window, the project language will change to German (de_DE). Of course, it is assumed that German has been defined as a project language and the text strings have been translated via the String Manager.


Report, Reliance SCADA


Reopen the Custom Report Manager and display the report in German.


Report, Reliance SCADA


In the same way, the report can be displayed in other Reliance modules.



Reliance Earth Icon

Top