Incorporating Fixed Text into a Page Definition
In Combining Field Processing and an Electronic Overlay, a territory sales report for salesman John Smith is created. Here, the territory sales report is incorporated into a larger format going to ACME's corporate headquarters in Chicago. Therefore, the identification for the region needs to appear on the report form. An overlay is used as a header for the composite report. This means that two overlays appear in the command stream: one carries over from Combining Field Processing and an Electronic Overlay and the other is the header.
So, as shown in Figure Input for the Corporate Version of an Individual Sales Report, three fixed inputs generate the final report: overlay SLSRPT, overlay HDR, and the fixed regional identification text. (It is the second item that is worked into the page definition in this example.)
Input for the Corporate Version of an Individual Sales Report
The data file used to generate this report is the same as the one shown in Figure Electronic Overlay and Data File for a Sales Report.
FORMDEF CORP ; OVERLAY SLSRPT ; OVERLAY HDR ; SUBGROUP OVERLAY SLSRPT HDR ; PAGEDEF CORP WIDTH 6 IN HEIGHT 7 IN ; PRINTLINE POSITION 1.9 IN 2.5 IN ; /*RECORD 1 */ FIELD TEXT C 'SOUTHWEST REGION' ; /*DEFAULT FIELD TEXT */ /*POSITION */ FIELD POSITION -.2 IN NEXT /*NOTE NEGATIVE VALUE */ TEXT 1 C 'JIM JONES - MANAGER' ; FIELD START 1 LENGTH 23 POSITION .1 IN .8 IN ; PRINTLINE POSITION 2 IN 3.7 IN ; /*RECORD 2 */ FIELD START 1 LENGTH 9 ; /*DEFAULT FIELD */ /*POSITION */ FIELD START 10 LENGTH 5 POSITION 2.5 IN * ; PRINTLINE POSITION 1.5 IN 4 IN ; /*RECORD 3 */ FIELD START 1 LENGTH 4 ; SETUNITS LINESP 4 LPI ; PRINTLINE REPEAT 4 /*RECORDS 4-7 */ POSITION .4 IN 4.7 IN ; FIELD START 1 LENGTH 7 ; /*DEFAULT FIELD */ /*POSITION */ FIELD START 10 LENGTH 3 POSITION 1.6 IN * ; FIELD START 16 LENGTH 3 POSITION 2.9 IN * ; FIELD START 21 LENGTH 3 POSITION 4.3 IN * ;
In the previous command stream, the same basic commands from Combining Field Processing and an Electronic Overlay are used, although the positions of fields have been changed to accommodate the new layout.
New FIELD commands with TEXT subcommands have been inserted in the first PRINTLINE command to produce the regional text, which is positioned at the bottom of the header form. The 1 is a duplication parameter indicating how many times the fixed text is to be repeated. The C can precede single-byte characters such as those used, for example, to write English or German. Both 1 and C are the default values for a TEXT subcommand. The text you want inserted appears between single quotation marks. Observe how the POSITION subcommands change to accommodate both fixed text and record-1 text.
Figure The Corporate Version of the Sales Report with Fixed Text shows how the finished output looks.