All DEF_XXXXX commands allow the definition of print lines that span multiple print lines. For instance, to print a report heading like this:

     Date printed : DD/MM/YY
Company      : XXXXXXXXXX
Division     : XXXXXXXXXXXXXXXXXXXX

you can use three separate DEF_HEAD commands like this:

     DEF_HEAD  NAME(#HEAD01) FIELDS((#DATE *L1 *C2))
DEF_HEAD  NAME(#HEAD02) FIELDS((#COMP *L2 *C2))
DEF_HEAD  NAME(#HEAD03) FIELDS((#DIV  *L3 *C2))

or just one DEF_HEAD command like this:

     DEF_HEAD  NAME(#HEAD) FIELDS((#DATE *L1 *C2)(#COMP *L2 *C2) 
          (#DIV *L3 *C2))

Of these two methods, the last one is preferred because:

  • It is slightly more efficient, both during function definition and during function execution.
  • It is easier to use with the report design facility.

When setting up heading (DEF_HEAD) or foot (DEF_FOOT) lines you should use one and only one command to define all print lines where ever possible.

However, when setting up detail (DEF_LINE) or break (DEF_BREAK) lines there is one more consideration to be made in deciding whether to use one DEF_XXXXX command or more.

Consider a detail report that is to look like this:

 Customer                                                          Address
 XXXXXXXXXXXXXXXXXXXXXXX    XXXXXXXXXXXXXXXXXXXXXXXXXXX
                                                       XXXXXXXXXXXXXXXXXXXXXXXXXXX
                                                       XXXXXXXXXXXXXXXXXXXXXXXXXXX
                                                       Postcode : 9999
 
 XXXXXXXXXXXXXXXXXXXXXXX    XXXXXXXXXXXXXXXXXXXXXXXXXXX
                                                       XXXXXXXXXXXXXXXXXXXXXXXXXXX
                                                       XXXXXXXXXXXXXXXXXXXXXXXXXXX
                                                       Postcode : 9999
 
 XXXXXXXXXXXXXXXXXXXXXXX    XXXXXXXXXXXXXXXXXXXXXXXXXXX
                                                      XXXXXXXXXXXXXXXXXXXXXXXXXXX
                                                      XXXXXXXXXXXXXXXXXXXXXXXXXXX
                                                      Postcode : 9999

These detail lines could be defined like this (row and column details have been omitted):

     DEF_LINE NAME(#DET01) FIELDS(#CUSNAM #CUSAD1) 
          IDENTIFY(*COLHDG)
DEF_LINE NAME(#DET02) FIELDS(#CUSAD2) IDENTIFY(*NOID)
DEF_LINE NAME(#DET03) FIELDS(#CUSAD3) IDENTIFY(*NOID)
DEF_LINE NAME(#DET04) FIELDS(#POSTCD) IDENTIFY(*LABEL)

or like this:

     DEF_LINE NAME(#DETAIL) FIELDS((#CUSNAM *L1 *C2  *COLHDG)
                              (#CUSAD1 *L1 *C39 *COLHDG)
                              (#CUSAD2 *L2 *C39 *NOID  )
                              (#CUSAD3 *L3 *C39 *NOID  )
                              (#POSTCD *L4 *C39 *LABEL ))

These two methods of defining the detail portion of the report may produce slightly different results.

Since all the lines defined in one DEF_XXXXX command are considered to be part of the same "cluster" of lines they are always printed on the same page.

Thus, by using the first definition method (four separate commands) information about a customer may be "split" over two pages like this:

  XXXXXXXXXXXXXXXXX    XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                                          XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                                          XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                                          Postcode : 9999
                                                                                                           Bottom
  XXXXXXXXXXXXXXXXX    XXXXXXXXXXXXXXXXXXXXXXXXXXXXX  of page
                                                                                                                1
 
                                                                                                                 Top
  Customer                              Address                                                  of page
                                               XXXXXXXXXXXXXXXXXXXXXXXXXXXXX       2
                                               XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                                               Postcode : 9999
 
  XXXXXXXXXXXXXXXXXXX    XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                                               XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                                               XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                                               Postcode : 9999

If the second method was used (one command to define all four print lines), this would not happen. If all four print lines could not be fitted onto the page a new page would have been started.

The choice here depends upon whether or not the "split" is acceptable or even required for the report being designed.

  • No labels