7 21 1 DEF_HEAD Parameters

LANSA Technical

7.21.1 DEF_HEAD Parameters

ACROSS_SEP

DESIGN

DOWN_SEP

FIELDS

FOR_REPORT

IDENTIFY

NAME

TEXT

TRIGGER_BY

NAME

Specifies the name that is to be assigned to the group of report print lines defined by this command. The name specified must be unique within the function.

FIELDS

Specifies the field(s) that are to be printed on the report. An expandable group expression is allowed in this parameter.
Only RDML fields are supported.

TRIGGER_BY

Specifies the condition that is be used to "trigger" the printing of the heading line(s) defined by this command.

*OVERFLOW, which is the default value, indicates that the heading lines should be printed when the previous report page is full (ie: has reached overflow).

Otherwise, specify a list of field names (or an expandable group expression) that are to be used to trigger the printing of the heading line(s). Every time any report line is printed LANSA compares the fields nominated in the list with their previous values. If any field nominated in the list has changed value the heading line(s) will be produced.

To demonstrate the use of the TRIGGER_BY parameter consider the following example:

DEF_HEAD  NAME(#HEADING) FIELDS(#COMPANY) TRIGGER_BY(#COMPANY)
DEF_LINE  NAME(#DETAIL)  FIELDS(#REGION #PRODUCT #VALUE)
 

Note that a new page is triggered by change of #COMPANY, so the report might look like this:

           Company : ACME                  Page 1

 

      Region  Product         Value          

       XXXXX  XXXXXXXXXXXXX  999.99          

       XXXXX  XXXXXXXXXXXXX  999.99          

       XXXXX  XXXXXXXXXXXXX  999.99          

 

 

 

      Company : ALLIED                     Page 2

 

      Region  Product         Value          

       XXXXX  XXXXXXXXXXXXX  999.99          

       XXXXX  XXXXXXXXXXXXX  999.99          

 

 

Note how page 2 is "triggered" by the change of company name and that page 1 was not full when page 2 was started.

If company ACME had more information than would fit on 1 page, then the report would be produced like this:

      Company : ACME                      Page 1

 

      Region  Product         Value          

       XXXXX  XXXXXXXXXXXXX  999.99          

       XXXXX  XXXXXXXXXXXXX  999.99          

       XXXXX  XXXXXXXXXXXXX  999.99          

       XXXXX  XXXXXXXXXXXXX  999.99          

       XXXXX  XXXXXXXXXXXXX  999.99          

       XXXXX  XXXXXXXXXXXXX  999.99          

       XXXXX  XXXXXXXXXXXXX  999.99          

 

 

      Region  Product         Value       Page 2

 

       XXXXX  XXXXXXXXXXXXX  999.99          

       XXXXX  XXXXXXXXXXXXX  999.99          

       XXXXX  XXXXXXXXXXXXX  999.99          

 

 

      Company : ALLIED                     Page 3

 

      Region  Product         Value          

       XXXXX  XXXXXXXXXXXXX  999.99          

       XXXXX  XXXXXXXXXXXXX  999.99          

 

 

Note how the company name did not print on page 2. This is because the DEF_HEAD command indicates that the heading should only be produced on change of #COMPANY, which did not change on the overflow from page 1 to page 2.

This feature allows the specification of "special" or "break" heading lines. However, in many cases, such as this one, the correct DEF_HEAD command is probably:

DEF_HEAD  NAME(#HEADING) FIELDS(#COMPANY) 
          TRIGGER_BY(#COMPANY *OVERFLOW)
 

This states that the page heading details should be "triggered" by change of #COMPANY or page overflow, thus ensuring that the company name prints on every page, even when it is an overflow from the previous page.

TEXT

Allows the specification of up to 50 "text strings" that are to appear on the screen panel or report. Each text string specified is restricted to a maximum length of 20 characters.

When a text string is specified it should be followed by a row/line number and a column/position number that indicates where it should appear on the screen panel or report.

For example:

TEXT(('ACME' 6 2)('ENGINEERING' 7 2))
 

specifies 2 text strings to appear at line 6, position 2 and line 7, position 2 respectively.

Portability Considerations

In Visual LANSA this parameter should only be edited using the screen or report painter which will replace any text with a text map. DO NOT enter text using the command prompt or free format editor as it will not pass the full function checker if checked in to LANSA for i.

All Platforms

The text map is used by the screen or report design facilities to store the details of all the text strings associated with the screen panel or report lines.

Once a screen or report layout has been "painted" and saved, all text details from the layout are stored in a "text map". The text map is then subsequently changed by using the "painter" again.

The presence of a text map is indicated by a TEXT parameter that looks like this example

TEXT((*TMAPnnn 1 1))
 

where "nnn" is a unique number (within this function) that identifies the stored text map.

Some very important things about "text maps" and *TMAPnnn identifiers that you must know are:

  • Never specify *TMAPnnn identifiers of your own or change *TMAPnnn identifiers to other values. Leave the assignment and management of *TMAPnnn identifiers to the screen and report design facilities.
  • When copying a command that has an *TMAPnnn identifier, remove the *TMAPnnn references (ie: the whole TEXT parameter) from the copied command. If you fail to do this, then the full function checker will detect the duplicated use of *TMAPnnn identifiers, and issue a fatal error message before any loss occurs.
  • Never remove an *TMAPnnn identifier from a command. If this is done then the associated text map may be deleted, or reused in another command, during a full function check or compilation. Loss of text details is likely to result.
  • Never "comment out" a command that contains a valid *TMAPnnn identifier. This is just another variation of the preceding warning and it runs the same risks of loss or reuse of text.
  • Never specify *TMAPnnn values in an Application Template. In the template context *TMAPnnn values have no meaning. Use the "text string" format in commands used in, and initially generated by, Application Templates.

FOR_REPORT

Specifies the report with which this command should be associated. Up to 8 reports can be produced by a function at one time. Each report is identified by a number in the range 1 to 8. The default value for this report is report number 1.

DESIGN

Specifies the design/positioning method which should be used for fields that do not have specific positioning attributes associated with them.

*ACROSS, which is the default value for the DEF_HEAD command, indicates that fields should be designed "across" the report line (i.e.: one after another).

*DOWN indicates that the fields should be designed "down" the report page (ie: one under another).

IDENTIFY

Specifies the default identification method to be used for fields that do not have specific identification attributes associated with them.

*LABEL, which is the default value for the DEF_HEAD command, indicates that fields should be identified by their associated labels.

*COLHDG indicates that fields should be identified by their associated column headings.

*NOID indicates that no identification of the field is required. Only the field itself should be included into the report line(s).

DOWN_SEP

Specifies the spacing between lines on the report that should be used when automatically designing a report. The value specified must be a number in the range 1 to 10. The default value for the DEF_HEAD command is 1.

ACROSS_SEP

Specifies the spacing between columns on the report that should be used when automatically designing a report. The value specified must be a number in the range 0 to 10. The default value for the DEF_HEAD command is 5.