Reporting > Native reporting system > Reporting system command language > FIELD command
  
FIELD command
Redefining predefined field attributes and accessing user-defined fields
Use the FIELD command to specify user-defined fields that you have already defined in the USRPROPS.TXT file. Each of the predefined fields in the database have default characteristics for length, typeface, and column width instructions used to format printed field content. The FIELD command enables you to override the defaults of a predefined field or identify the fields in your project that are defined by you (user-defined fields) and set the characteristics for them when they are to be extracted for a report.
The FIELD command is valid in the global or local definition block of the Report Definition file. If you place the command in the global report block, it affects every report in the Report Definition file. If you place the command in the local report block, it affects only that report.
See also:
Redefining predefined field attributes
Defining user-defined fields and attributes
FIELD command syntax
FIELD field-identifier {
subcommand subcommand-identifier
subcommand subcommand-identifier }
or
FIELD field-identifier
{
SOURCE PROPERTY property-name
TYPE [ CHARACTER | NUMERIC | BOOLEAN | MEMO | DATE | TIME ]
LEGEND constant-string
LENGTH numeric-length
DECIMALS numeric-length
WIDTH numeric-inches
FONT font-identifier
NAMESTUB eight-character-upper-string
}
FIELD command subcommands
The FIELD command uses subcommands to communicate specific changes to redefine predefined fields (see Redefining predefined field attributes) or to access and define user-defined fields and their attributes (see Defining user-defined fields and attributes).
This graphic is described in the surrounding text.
Rules for using the FIELD command
To create a correct FIELD command statement (including subcommands and subcommand-identifiers) follow these rules:
1 Use a { (BEGIN) command before the first subcommand used in each FIELD statement.
2 Use an } (END) command after the last subcommand-identifier to end the entire FIELD statement.
3 User-defined fields must be defined in a FIELD statement before they can be used to extract report information through the use of a SELECT, WHERE, or ORDERBY command.
4 The subcommands DECIMALS, SOURCE, and TYPE are valid only when used with a user-defined field.
5 The FIELD command is valid in the global or local definition blocks of the Report Definition file. If you place the command in the global report block, it affects every report in the Report Definition file. If you place the command in the local report block, it affects only that report.
See also Defining user-defined fields and attributes and Redefining predefined field attributes.
Examples: FIELD command
Example 1
FIELD "PK" { SOURCE PROPERTY "Key" LENGTH 1 TYPE BOOLEAN }
FIELD "FK" { SOURCE PROPERTY "Foreign Key" LENGTH 1 TYPE BOOLEAN }
The two user-defined fields called PK and FK are synonyms for the database fields called Key and Foreign Key, respectively.
Example 2
FIELD "Current" { LENGTH 1 TYPE BOOLEAN }
Adding this statement to the report requires that you must open the diagram on which you want to report before you run the report.
See also Defining user-defined fields and attributes and Redefining predefined field attributes.
Parent topic
Reporting system command language