Combining Two Reports into One Printout

This example combines two data files and two page layouts into one printout, also building on Combining Field Processing and an Electronic Overlay.

Figure Input for a New Report Produced from the Combined Data Files shows the new data and a new overlay.

Input for a New Report Produced from the Combined Data Files

Input for a New Report Produced from the Combined Data Files

Here is the command stream needed to generate both pages of the preceding report:

FORMDEF SLSCOM ;
  COPYGROUP SLSRPT ;
    OVERLAY SLSRPT ;
    SUBGROUP OVERLAY SLSRPT ;
  COPYGROUP COMRPT ;
    OVERLAY COMRPT ;
    SUBGROUP OVERLAY COMRPT ;
PAGEDEF SLSCOM ;
  FONT M104 ;
  FONT M105 ;
  PAGEFORMAT SLSRPT ;                    /*SALES REPORT*/
    PRINTLINE  FONT M104
               POSITION 2 IN .5 IN ;
      FIELD START 1 LENGTH 23 ;
    PRINTLINE  POSITION 2 IN .75 IN ;
      FIELD START 1 LENGTH 9 ;           /*DEFAULT FIELD POSITION*/
      FIELD START 10 LENGTH 5
            POSITION 2.3 IN * ;
    PRINTLINE POSITION 1.5 IN 1 IN ;
      FIELD START 1 LENGTH 4 ;
    PRINTLINE  REPEAT 4
               POSITION .3 IN  1.8 IN ;
      FIELD START 1 LENGTH 7 ;           /*DEFAULT FIELD POSITION */
      FIELD START 11 LENGTH 3
            POSITION 1.5 IN * ;
      FIELD START 16 LENGTH 3
            POSITION 3 IN * ;
      FIELD START 21 LENGTH 3
            POSITION 4.3 IN * ;
  PAGEFORMAT  COMRPT ;                   /*COMMISSION REPORT      */
    PRINTLINE  FONT M105                 /*RECORD 8               */
               POSITION 1.3 IN  1.7 IN ;
      FIELD START 1 LENGTH 18 ;
    PRINTLINE POSITION 3.3 IN 2.2 IN ;   /*RECORD 9               */
      FIELD START 1 LENGTH 4 ;           /*DEFAULT FIELD POSITION */
      FIELD START 10 LENGTH 1
            POSITION 1.7 IN * ;
  PRINTLINE POSITION 1.9 IN 2.6 IN ;     /*RECORD 10              */
    FIELD START 1 LENGTH 10 ;
  PRINTLINE POSITION 4.2 IN 2.9 IN ;     /*RECORD 11              */
    FIELD START 1 LENGTH 1 ;
  PRINTLINE POSITION 1 IN 3.7 IN ;       /*RECORD 12              */
    FIELD  START 1 LENGTH 7 ;
  PRINTLINE POSITION 1.7 IN 4.2 IN ;     /*RECORD 13              */
    FIELD START 1 LENGTH  15 ;

Although requiring a complex series of commands, the following commission report is handled much like any other field processing problem: the data must be carefully mapped into the overlay exactly where it is wanted. If, as in this example, you change copy groups and page formats, both the Invoke Medium Map structured field and the Invoke Data Map structured field must be inserted into the data file where the changes are desired. Here they occur together.

Figure The Sales and the Commission Reports shows both the commission report and the sales report. With page printers and with careful data positioning, such reports look like they were individually prepared with no differences in the presentation of the fixed data.

The Sales and the Commission Reports

The Sales and the Commission Reports