Movicon Help on Line - Rel. 11.7.1302
Movicon offers a very userfriendy textual report tool. The functional logic of these reports is based on using a layout "template" file to define the report file's structure. This layout supports fields with a special syntax which can be used to define which variables, or which Data Logger or Historical Log fields are to be dsplayed and in which format. The textual reports can also be defined to display some values of variables and values of Data Logger or Historical Log fields in the same report. In addition, there are other special fields for date and time printouts and page number. The layout file must be in a format that can be opened in text mode (ie. Rich Text Format or Text).
|
Textual reports are also supported in runtime for Windows CE whereby simple reports can be viewed, printed and saved. |
|
Textual reports can be used to display Data Logger/Recipe data or data from the Historical Log tables. In this case, data extraction queries are applied by default to the 'Alarms' table as well. |
Below are listed the commands which have been provided in the Command List's "Report-Recipe" and "Alarm" categories to support the textual report management:
All these commands are synchronous to the user interface. This means that the project's user interface objects cannot be accessed until the command has been completely executed. For instance, the "View Textual Report" command requires that you close the application that opened the temporary file before using this command.
The commands listed above also need parameters to be set and which can be found in the Command List's "Report-Recipe" and "Alarm" categories. These parameters are:
Textual Report Template File (Layot File)
Textual Report Destination File
For further information on the above listed commands and parameters, please refer to the "Textual Report Commands and Parameters" section.
|
If no path is specified for the "Layout File", it will be searched for in the project's resource folder by default. If no path is specified for the "Destination File", it will be created in the project's "DLOGGERS" folder by default. |
|
Commands used to manage Textual Reports can also be executed by using the "ExecuteCommand()" script function. |
If errors occur while executing commands to manage Textual Reports, the cause will be reported in the project's Historical Log and Output Window. For more details on the list of error messages and their causes, please see: "Textual Report Errors".
Template for Textual Reports (Layout File)
The Template document (Layout File) must be text type. The formats supported are generic ascii and unicode text files (.txt), and "Rich Text Format" files (.rtf). To edit this document you will need to use an external program that is not currently provided by Movicon. We recommend that you use "Notepad" for generic text files and "WordPad" for "Rich Text Format" files.
|
We advise against using "Microsoft Word" to edit "Rich Text Format" files. This is because formatting characters may be added in between the special fields managed by the parser of the text report when saving it as a "Microsoft Word" file. As a consequence, you will not be able to view these special fields unless you re-open the file with WordPad, re-format it and save it again. |
In addition to normal text, you can also insert fields with special syntaxes in the Layout File. These fields will determine the point in which the textual report manager is to insert variable values or Data Logger or Historical Log data. The square brackets are used to determine the start and end of a special field. The special fields can be the following:
Variable Field
You must use the following syntax to insert a variable value from the project's RealTimeDB:
[Variable|Format]
The "Variable" part indicates the name of a project variable. The special field is therefore replaced with the variable's current value the instant the command is executed. If this variable is nonexistent, the special field will be deleted and replaced with empty text.
The "Format" part indicates the format to be used for representing the variable's value (see paragraph "Data Formats" for further details). When the variable is string type and you need that a fixed number of characters be printed in order not to mismatch format alignments, insert the same number of "x" as there are characters to be printed in the "Format" parameter:
[Variable|xxxxxxxxxx]
In the example above, after having inserted 10 "x", the number of characters printed will be equal to 10. When the string is composed of number less than 10 characters, a number of spaces equal to the number of characters missing will be inserted. Checks are only performed when the number of characters is less than the number set. If the string exceeds the set number of characters, all of the string's characters will be printed.
Data Logger or Historical Log Field
To insert a value in the Data Logger column or Historical Log column, you must used the following syntax:
[$Column$|Format]
The "Column" part indicates the name of the Data Logger or Historical Log column to be displayed. The special field is then replaced with the value of the column presented in the data extracted from the Data Logger or Historical Log, using the row currently in use (the first row if command for next row has not been used). This special field will be deleted and replaced with empty text, if the column does not exist in the data set extracted from the Data Logger or Historical Log.
The "Format" part indicates the format to use to represent the field value (see paragraph "Data Formats" for further details). When the database field is string type and you need that a fixed number of characters be printed in order not to mismatch format alignments, insert the same number of "x" as there are characters to be printed in the "Format" parameter:
[$Colonna$|xxxxxxxxxx]
In the example above, after having inserted 10 "x", the number of characters that will be printed will be equal to 10. When the string is composed of number less than 10 characters, a number of spaces equal to the number of characters missing will be inserted. Checks are only performed when the number of characters is less than the number set. If the string exceeds the set number of characters, all of the string's characters will be printed.
|
Where SQLCE is concerned, a integer Value can be displayed by specifying the "%g" format with the following syntax: [$column_name$|%g]. In fact, when you use the "x" format, the '0' value will always be reported in the Textual Report. |
Data Logger or Historical Log next row field
To insert the next value of a Data Logger or Historical Log column you must use the following syntax:
[!$Column$|Format]
Unlike the previous command, the data set pointer is moved to the next row before retrieving the column's value.
Page Number Field
To insert a Page number field you must use this syntax:
[&PageInfo&]
This special field is replaced with the current page number when the command creates additional pages. The page number is set to the "1" value at the command start and increases every time a new page of data needs to be created by re-reading the Layout File.
Date Field
To insert a Date field you must use this syntax:
[&Date&]
This special field is replaced with the current operating system's date when the command is executed. The date is formatted using the operating system's local settings for the short date format.
Time field
To insert a Time field you must use this syntax:
[&Time&]
This special field is replaced with the operating system's current time when the command is executed. The time is formatted using the operating system's settings.
Viewing Data Logger or Historical Log values
When the Data Logger or Historical Log fields are displayed in the Textual Report, data recordsets are passed the instant the report is opened according to which selection query has been set. When no query has been set, all the table's records will be loaded. At this point, the values of the recordset's first record are displayed on the report page. If there are other records, the pointer will then be increased and the new records will be inserted on a new report page. In this way, the number of report pages will be the same number as there are records resulting from the selection query.
The report example below shows how values are displayed for project values and Data Logger fields. In this case, the same number of report pages will be created for the same number of records selected by the data extraction query.

In order to display recordset data in table mode on the same page, you will need to insert the same database field as many times needed by using the syntax used to point to next record ([!$Column$|Format]). By doing this the records will display on the same report page. However, a new report page will be created if the number of records selected is higher than the number of rows set in the report.
The below report example shows how Data Logger values are displayed in table format.
