Reporting : Native reporting system : Reporting system command language : SELECT LABEL subcommand
  
SELECT LABEL subcommand
Example 1 – SELECT LABEL TOP default subcommand
These two samples are identical. TOP is the default option for the LABEL subcommand. Either statement creates three individual columns in a report and labels them Name, Type, and Class. One label is placed at the top of each column in order from left to right.
Sample A
Sample B
SELECT Name, Type, Class
SELECT Name LABEL TOP,
Type LABEL TOP,
Class LABEL TOP
Sample output
The report statements in Samples A and B produce this output where the legend for each column is placed at the top. You may need to add more commands to position columns exactly like this.
Name
Type
Class
Data Flow Gane & Sarson
Reserve Book Process
Diagram
Entity Relation
Book Reservation
Diagram
Entity Relation
Form Letter Processing
Diagram
Entity Relation
Inventory Tracking
Diagram
Entity Relation
Library System
Diagram
Example 2 – SELECT LABEL LEFT subcommand
Report columns generated by the LABEL Left subcommand are positioned at the left margin; therefore, when two fields are specified in a single SELECT statement, and both are specified as LABEL Left, the report has one column along the left margin.
Note For an example of how to use the POS subcommand to position the fields differently, see Example 3 – SELECT LABEL and POS subcommands.
Sample A
Sample B
SELECT Name LABEL Left
SELECT Type LABEL Left
SELECT Name LABEL Left,
Type LABEL Left
Sample output
The report statements in Samples A and B produce this output where each value of name and type has a label to the left of it. Colons are automatically placed after the heading when the label is placed to the left.
Name : Book Reservation
Type : Entity Relation
Name : Form Letter Processing
Type : Entity Relation
Name : Inventory Tracking
Type : Entity Relation
Name : Library System
Type : Entity Relation
Example 3 – SELECT LABEL and POS subcommands
Placing the legend left of the field value normally creates a report of one column down the left margin. You can separate the fields and print them in side-by-side columns. To do this, you use the POS subcommand to create two columns of information, each labeled on the left.
Sample A
SELECT Name LABEL Left POS 0,0,
Type LABEL Left POS 3,0
The above statement produces two columns: one for the Name field, and one for the Type field. The column containing the name field is positioned along the left margin, and the column containing the type field is positioned three inches to the right of the left margin. The output takes the following form.
Sample output
The report statements in Sample A produce this output where each value of the Name field is at the left margin (POS 0,0) and each value of the Type field is three inches from the left margin. Both columns have legends to the left of the field value. Colons are automatically placed after the heading when the label is placed to the left.
Name : Book Reservation
Name : Form Letter Processing
Name : Inventory Tracking
Name : Library System
Type : Entity Relation
Type : Entity Relation
Type : Entity Relation
Type : Entity Relation
Related topics
Examples – SETTING LABEL subcommand
LABEL subcommand
Parent topic
Reporting system command language