Note: If the report format file exists, it is loaded into the property grid for you to edit. If the file does not exist, Citect SCADA creates a new file.
To change the report format file:
The report format file specifies how data is formatted in a report. You can use fixed text, Cicode expressions, and database variables in any report.
You use a text editor that is supported by Windows to create (and modify) the report format file. If your report format file is in RTF (Rich Text Format), use Microsoft Wordpad.
Including fixed text
You can include fixed text in the report, specifying the text exactly as you want it to appear (for example, Name of Report, Description, and so on).
Including OLE (RTF files only)
Objects can be linked to or embedded within an RTF report format file; however, such objects will not be displayed or printed from Citect SCADA.
Using fonts (ASCII format only)
If your format file is in ASCII format, you can use any text font supported by Windows in the report. To specify a font, use the PrintFont()
function. RTF format files do not require this function, as they use the formatting features of the host word processor.
Including Cicode expressions and variables
You can include Cicode expressions and variables by enclosing them (and optional format specifications) in braces {} - for example:
{TIME(1) }
{PV12:####.##}
{PV12:4.2}
The size of each field (number of characters) is determined by either the format specification, or by the number of characters between the braces. In the above example, the variable PV12 is formatted with four characters before the decimal point and two characters after.
You do not have to include the format, for example:
{PV12}
Here, the variable is formatted using only four characters (the number of characters between the braces).
The following rules apply when logging a report to a database device:
{TIME(1) }{PV12:####.##}{PV12:4.2}
Including blocks of Cicode
You can include a block of Cicode, using the following format:
{CICODE}
Statements;
{END}
The block of Cicode is delimited by the commands {CICODE}
and {END}
. After the {END}
command, the report switches back into WYSIWYG mode. If the entire report is Cicode or the last section is Cicode, the {END} command is not necessary.
A block of Cicode does not send any output to the device unless you use either the Print()
or PrintLn()
functions. If you use one of these functions, the argument is printed to the device.
Cicode variables (ASCII format only)
You can also declare variables for use within your Cicode block. This is not available in RTF or HTML format files. Declare any variables at the beginning of the file (i.e. before any report format or Cicode). Add a {CICODE}
block first; for example:
{CICODE}
INT nVar1;
STRING sVar2;
Statements;
{END}
Remainder of report
Including comments
You can include comments by using the comment character `!' enclosed in braces - for example:
{!This is a Comment}
A comment in the body of a report differs from a comment in a Cicode block: a comment in a Cicode block does not require braces.
Including other report elements
The following table describes other elements you can include in reports.
To... |
Do this... |
---|---|
Issue a form feed |
Use a form feed specifier: {FF} |
Include a plot |
Use the Plot functions. |
Include trend data |
Use the TrnGetTable() function. |
Include trend graphs |
Use the TrnPlot() function. |
Report Example
The following is an example of a report format file (for a printer or ASCII file device):
-----------------------------------
SHIFT REPORT
-----------------------------------
{Time(1) } {Date(2) }
Shift Production {Shift_Prod:###.##} tons
Total Production {Total_Prod} tons
{! The following Cicode displays "Shift Report Complete" on the screen}
{CICODE}
Print("End of Report")
Shift_Prod = 0; ! Reset the Shift production tonnage
Prompt("Shift Report Complete");
{END}
{FF}
This report produces the following output to the device and displays "Shift Report Complete" on the graphics page.
-----------------------------------
SHIFT REPORT
-----------------------------------
6:00am 12/3/92
Shift Production 352.45 tons
Total Production 15728 tons
End of Report
See Also
Published June 2018