Applies To:
  • CitectSCADA 3.40/4.20 Service Pack F

Summary:
To allow reports to print on a landscape page without changing the Control Panel defaults use the printer's escape codes. 

Solution:
To configure the printer to allow reports to be printed in landscape without changing the default options for the printer in control panel requires the printer's escape codes. A list of escape codes for a particular printer is usually found in the printer documentation.

Escape codes contained within a report will be filtered out unless the output device for the report is defined as being of Type: ASCII_DEV.

For example: The definition for Production_Report:

Name: Production_Report
Time: 06:00:00 Period: 24:00:00
Report Format File: Prod.rpt
Output Device: Rep_Printer
Comment: Sample Production Report
Production_Report 06:00:00 Period: 24:00:00 Prod.rpt Rep_Printer Sample Production Report

The definition for Rep_Printer:

Name: Production_Report
Format:
Header:
FileName: //server/printer
Type: ASCII_DEV
No. Files: -1
Time: Period:
Comment: Network Report Printer
Production_Report //server/printer ASCII_DEV -1 Period: Network Report Printer

The production report would then include the escape codes in the appropriate places. As the printer device is defined as an ASCII device a form feed command {FF} will need to be placed at the end of the report. In the following example the report is printed in a landscape format with the heading in a different font. The » symbol represents the escape character (ascii character 27). Each control string in the example is on a separate line for clarity, in practice one line would be used for each group of control strings.

The definition for Prod.rpt

{!set landscape}
»&l1O
{!set A4 paper size}
»&l26A
{!select Arial Bold 12 point font}
»(10U»(s1p12v0s3b16602T

PLANT 1 PRODUCTION REPORT - {Time(1):########} {Date(2):########}

{!set Courier 14cpi font}
»(10U»(s0p14h0s0b4099T
{!set 8 lines per inch}
»&l8D

Product A:
Total Production: {A_Total:####} T
Average Production Rate: {A_Average:###.#} T/H

Product B:
Total Production: {B_Total:####} T
Average Production Rate: {B_Average:###.#} T/H

Product C:
Total Production: {C_Total:####} T
Average Production Rate: {C_Average:###.#} T/H
{FF}

 

Keywords:
 

Attachments