Customizing a Column Title
A column title identifies the data in a report. Use the AS phrase to change the default column title for customized data identification or more desirable formatting. You can change a column title:
- In a request.
- In a Master File.
A column title defaults to the field name in the Master File. For a calculated value (one created with COMPUTE), the title defaults to the field name in the request.
Using Default Column Titles
TABLE FILE EMPDATA SUM SALARY BY DEPT BY LASTNAME WHERE DEPT IS 'SALES' OR 'CONSULTING' OR 'ACCOUNTING' ON TABLE SET PAGE-NUM OFF ON TABLE SET STYLESHEET * TYPE=REPORT, GRID=OFF, $ ENDSTYLE END
The report output illustrates these default column titles:
- The column title for the field named in the display command (SUM) is SALARY.
- The column titles for the fields named in the BY phrases are DEPT and LASTNAME.
The output is:
Limits for Column Titles
Customize a Column Title in a Request
fieldname AS 'title_line_1 [,title_line_2,...]'
To specify a multiple-line column title, separate each line with a comma.
To customize a column title for a calculated value, use the syntax:
COMPUTE fieldname[/format] = expression AS 'title'
For related information, see Creating Temporary Fields.
Tip:
- To suppress
the display of a column title, enter two consecutive single quotation
marks without the intervening space. For example:
PRINT LAST_NAME AS ''
- To display underscores, enclose blanks in single quotation marks.
- If you use an AS phrase for a calculated value, repeat the COMPUTE command before referencing the next computed field.
- Multi-line column titles created with the AS phrase are not supported for ACROSS fields.
Customizing Column Titles in a Request
This request customizes the column titles for the field named in the SUM command (SALARY), and the fields named in the BY phrases (DIV and DEPT).
TABLE FILE EMPDATA SUM SALARY AS 'Total,Salary' BY DIV AS 'Division' BY DEPT AS 'Department' WHERE DIV EQ 'NE' OR 'SE' OR 'CORP' HEADING "Current Salary Report" ON TABLE SET STYLE * TYPE=REPORT,GRID=OFF,$ ENDSTYLE END
The output is:
Suppressing a Column Title
This request suppresses the column title for LAST_NAME. It also illustrates a multiple-line column title (EMPLOYEE NUMBER) for the data for EMP_ID.
TABLE FILE EMPLOYEE PRINT FIRST_NAME AS 'NAME' AND LAST_NAME AS '' BY DEPARTMENT BY EMP_ID AS 'EMPLOYEE,NUMBER' ON TABLE SET PAGE-NUM OFF ON TABLE SET ONLINE-FMT HTML ON TABLE SET STYLESHEET * TYPE=REPORT, GRID=OFF, $ ENDSTYLE END
The output is:
Customizing a Column Title for a Calculated Value
This request customizes the column title for the calculated value REV.
TABLE FILE SALES SUM UNIT_SOLD RETAIL_PRICE COMPUTE REV/D12.2M = UNIT_SOLD * RETAIL_PRICE;AS 'GENERATED REVENUE' BY PROD_CODE WHERE CITY EQ 'NEW YORK' ON TABLE SET PAGE-NUM OFF ON TABLE SET ONLINE-FMT HTML ON TABLE SET STYLESHEET * TYPE=REPORT, GRID=OFF, $ ENDSTYLE END
The output is:
Customizing a Column Title in a Master File
You can change the default column title using the optional TITLE attribute for a field. Any formatting you apply to the field will be applied to its customized title.
See the ibi™ WebFOCUS® Developing Reporting Applications manual for details on the TITLE attribute.
Distinguishing Between Duplicate Field Names
The command SET QUALTITLES determines whether or not duplicate field names appear as qualified column titles in report output. A qualified column title distinguishes between identical field names by including the segment.
Column titles specified in an AS phrase are used when duplicate field names are referenced in a MATCH command, or when duplicate field names exist in a HOLD file.
Distinguish Between Duplicate Field Names
SET QUALTITLES = {ON|OFF}