How to display tag values in custom reports of type FastReport

August 26, 2019

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).

Custom Reports - Tags, Reliance SCADA

Custom Reports – Tags

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.

Custom Report Manager

Custom Report Manager

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

Select Custom Report Type dialog

Select Custom Report Type dialog

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,

Custom Report Manager

Custom Report Manager

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

Select Tag dialog

Select Tag dialog

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

Custom Report Manager

Custom Report Manager

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.

Custom Report Manager

Custom Report Manager

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.

Custom Report Manager

Custom Report Manager

FastReport Designer, Reliance SCADA

FastReport Designer

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.

FastReport Designer, Reliance SCADA

FastReport Designer

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.

Edit Variables, Reliance SCADA

Edit Variables

Next, click on Add String from Project.

Edit Variables, Reliance SCADA

Edit Variables

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.

Select String, Reliance SCADA

Select String

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

Edit Variables, Reliance SCADA

Save the changes by choosing the OK command

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.

FastReport Designer, Reliance SCADA

FastReport Designer

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 – Properties, Reliance SCADA

Text – Properties

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 – Properties, Reliance SCADA

Text – Properties

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>

FastReport Designer, Reliance SCADA

FastReport Designer

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.

Custom Report Manager, Reliance SCADA

Custom Report Manager

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

Report, Reliance SCADA

Report

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

Report, Reliance SCADA

Report

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

Report

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

Report, Reliance SCADA

Report

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

Bulb, icon

Tip:

Haven't found what you were looking for? Use this form to inform us about it.

Related links


Example projects

Video tutorials

Frequently asked questions

Reliance training courses

Try the Reliance SCADA system right now!

Try the Reliance SCADA/HMI system on several sample visualizations.

Try the Reliance SCADA/HMI system on several sample visualizations or download the trial version installer to your computer for free.

Try the Reliance SCADA system right now Try the Reliance SCADA system right now Try the Reliance SCADA system right now