Use the WIDTH subcommand to specify the width of column widths in both tabular and matrix reports.
Tabular reports
Use the WIDTH subcommand with a SELECT command or FIELD command in a tabular report to indicate the exact space from the left to the right edge of a field regardless of the length of the field value or its font size. If column width is not specified, the column is as wide as the longest field value, including a top column heading, up to the maximum field length. If the field’s value is longer than the specified width, it gets truncated.
Specifying width is useful to limit the size of a field such as the Name field which defaults to its maximum of 31 characters unless it is shortened. The length of a field can also be controlled by using the LENGTH subcommand to specify a maximum number of characters.
The WIDTH subcommand is also used with the ROW command to specify the width of the column containing the row headings only; it does not influence the width of the cells formed at the intersection of columns and rows.
The column width for a tabular report can be specified in the Report Editor using the Property Layout section of the Select <class> Properties to Print dialog. Column width for matrix reports must be specified in the Text Editor.
WIDTH subcommand structure
The structure of the WIDTH subcommand is the same for each of these commands:
The WIDTH subcommand is followed by a numeric argument, specified in inches or centimeters depending on the Microsoft Windows measurement setting, and can include up to two decimal places.
Examples: WIDTH subcommand
Example 1: FIELD WIDTH subcommand
This example shows how to set the width of the column to contain its results.
Use this command statement in a global or local definition block to indicate the width of a predefined or user-defined field. The width command can contain up to two decimal spaces.
FIELD "Update Date" WIDTH 1.25,
If the command is used in the global definition block, it applies to all reports in the Report Definition file. If the command is used in the local definition block, it applies only to that report.
Example 2: SELECT WIDTH subcommand
This example shows how to set the width of the column to contain its results.
Use this command statement in a the local definition block only to indicate the width of a field and thereby override all other width instructions. The width command can contain up to two decimal spaces.
SELECT Name WIDTH 3.50, Type WIDTH 2.5
This command statement creates two columns in the report. The first column, Name, has a width of three and one-half inches. The second column, Type, has a width of two and one-half inches.
Example 3: SELECT WIDTH and POS subcommands
This example shows how to use WIDTH and POS to control the placement of vertical columns.
SELECT Name WIDTH 2 POS 0,0 Type WIDTH 2 POS 2.5,0
The WIDTH subcommand statements above place two columns in the report; Name and Type. Both columns are two inches wide. The Name POS subcommand statement (0,0) places the column at the left margin. A Type POS statement of 2.0,0 starts the Type column exactly where the Name column stops, which means any value that fills the Name column touches the value of the Type column.
This example shows a Type POS of 2.5,0 which means that 1/2 inch of white space is added to the Name column thereby making the report more readable.
Columns are always placed where specified by the POS command, regardless of the column width specified by the WIDTH command. Therefore, the X coordinate of the Type POS statement must be greater than the Name WIDTH specification to place white space between the columns.
X can be specified in inches or centimeters depending on the Microsoft Windows measurement setting, with up to two decimal positions.
Example 4: ROW and CELL WIDTH subcommands
This example shows how to use ROW and CELL command statements in a matrix report to control the row legend and individual cell width.
Use the WIDTH subcommand in a matrix report with the ROW command to specify the width of the row heading (first column) or with the CELL command to specify the width of a cell.
If you do not specify the row and cell widths, then width is determined by the size of the font used to print these field’s values.
Sample A: ROW WIDTH statement
ROW Name WIDTH 2 Type WIDTH 2
These ROW subcommands creates two rows. Each row is 2 inches wide. This column of the report might look like this:
Sample B: CELL WIDTH statement
CELL Name LEGEND Entity WIDTH 2 Type LEGEND Attribute WIDTH 2
These ROW subcommands creates two rows. Each row is 2 inches wide. This column of the report might look like this: