Print control attributes apply mostly to the UPRINT (unformatted print) command. The PRINT command (and associated DEF_XXXXX commands) facilitates all features described here in different and more advanced ways. Refer to the PRINT and DEF_XXXXX print definition commands for more details.
Also refer to Producing Reports Using LANSA in the Visual LANSA Developer Guide.
The use of the UPRINT command is recommended only for very simple list style reports. For serious application reporting, multilingual reporting or bi-directional language reporting use only the PRINT command.
|
Example
Consider a file called ACCOUNTS that contains the following fields and data:
Company (#COMP) |
Division (#DIV) |
Department (#DEPT) |
Expenditure (#EXPEND) |
Revenue (#REVNU) |
---|---|---|---|---|
01 |
1 |
ADM |
400 |
576 |
" |
" |
MKT |
678 |
56 |
" |
" |
SAL |
123 |
6784 |
" |
2 |
ADM |
46 |
52 |
" |
" |
SAL |
978 |
456 |
" |
3 |
ACC |
456 |
678 |
" |
" |
SAL |
123 |
679 |
02 |
1 |
ACC |
843 |
400 |
" |
" |
MKT |
23 |
0 |
" |
" |
SAL |
876 |
10 |
" |
2 |
ACC |
0 |
43 |
If the file is keyed by #COMP, #DIV and #DEPT, the following RDML program will produce a paginated report with subtotals from this file:
GROUP_BY NAME(#ACCOUNTS) FIELDS((#COMP *TOTLEVEL1
*NEWPAGE *ONCHANGE)
(#DIV *TOTLEVEL2)
(#DEPT *TOTLEVEL3)
(#EXPEND *TOTAL)
(#REVNU *TOTAL))
SELECT FIELDS(#ACCOUNTS) FROM_FILE(ACCOUNT)
UPRINT FIELDS(#ACCOUNTS)
ENDSELECT
ENDPRINT
The following points about the field attributes used should be noted: