Use the LEGEND subcommand to specify headings in both Tabular and Matrix reports.
Tabular reports
The reporting system uses the name of the predefined fields (see Predefined fields) encyclopedia fields to print the appropriate column legend. Some of the more common predefined field names are: Name, Type, Class, Update Date, Description, and so on. But, say you want to use a field you defined (user-defined fields) or change the predefined field name to something more appropriate, when necessary.
Use the LEGEND subcommand with a SELECT command or a FIELD command to specify a column heading to be used in place of the default column heading. You can specify a different LEGEND command be used for each entry in a SELECT command in your report.
Matrix reports
The LEGEND subcommand is also used with the ROW command to specify headings for the column that contains the row headings. The text specified in this subcommand replaces only the headings of the field-values specified by the ROW command.
The structure of the LEGEND subcommand is similar regardless of the command keyword you are using. However, the FIELD command requires a { (BEGIN) statement before and an } (END) statement after its subcommands:
The value of a constant-string is defined by you. It can be any text string you want to use to identify the column that lists the data contained in the field identified by the field-identifier.
Examples: LEGEND subcommand
These are examples of how the LEGEND subcommand is used with the FIELD, SELECT, and ROW command statements.
Shows how to use the ROW command statement in a Matrix report to print a row legend other than the predefined field name default.
Example 1: SELECT LEGEND subcommand
This example is replacing the name of the predefined field called Type with the constant-string Symbol Type.
SELECT Type { LEGEND "Symbol Type" }
This command is used in the local definition block and applies only to the report in which it is used. The instructions in this SELECT command statement override any instructions used in a FIELD command regardless of where that command is placed.
This is a sample of how the column legend (bold) printed report output would change if this command were used.