DEFINE COLUMN command

Used to create and add columns to existing views.

Syntax

DEFINE COLUMN view_name field_name <AS alternate_column_title>
<POSITION n> <WIDTH n> <PIC format> <SORT | SORT D> <KEY>
<PAGE> <NODUPS> <NOZEROS> <LINE n>

Parameters

view_name

Specifies the view to add the column to.

field_name

Specifies the field to create the column for. To use a field from a related table, specify the field name as table_name.field_name.

AS alternate_column_title

Optional. Specifies a column title that is different from the field name in the table layout. By default, the field name in the table layout is used as the column title. You can add line breaks to a column title by entering a semi-colon at each place where you want to start a new line. For example, to display Customer and Number on separate lines in a column, use the following syntax: AS Customer;Number

POSITION n

Specifies the position of the column in the view numerically from left to right. If this parameter is not specified, the column is placed as the rightmost column at the time that the column is added. If a position number is missing, ACL adjusts the column positions so that the columns are positioned sequentially. If a position number is already in use, the new column is placed to the left of the column already using the position number.

WIDTH n

Optional. Specifies the column width to use in views and reports. If this parameter is not specified, ACL uses the default width for the data type.

PIC format

Optional. This parameter only applies to Numeric fields. Specifies formatting (separators, decimals etc.) to apply to numeric values.

SORT | SORT D

Optional. Specifies that the column is to be sorted in ascending (SORT) or descending (SORT D) order.

KEY

Optional. Specifies that the column will be a break column in reports, which means that the report will be subtotaled and subdivided when the value of the column changes. ACL has the following restrictions on break fields:

  • Break columns must be character fields.

  • If a break column is set in the view, it must be the leftmost column.

  • The last column in the view cannot be a break column.

  • If you have more than one break column, all of the columns to the left of any additional break column must also be break columns.

PAGE

Optional. Specifies that a page break should be inserted after the totals for the specified key field.

NODUPS

Optional. Specifies that repeated values in a column (field) to be displayed as blanks in a report.

NOZEROS

Optional. Specifies that zero values in a column (field) to be displayed as blanks in a report.

LINE n

Optional. Specifies the number of lines in the column. If no value is specified, the column defaults to a single line. The value of n must be between 2 and 60.

Example

If the AR table is open, use the following commands to define a view called AR_Report from the “AR” table with six columns, which will be displayed in the listed order:

OPEN Ar
DEFINE VIEW AR_Report OK
DEFINE COLUMN AR_Report No AS "Customer Number" WIDTH 7 KEY
DEFINE COLUMN AR_Report Date AS "Invoice Date" WIDTH 10
DEFINE COLUMN AR_Report Due AS "Due Date" WIDTH 10
DEFINE COLUMN AR_Report Reference AS "Reference Number" WIDTH 6
DEFINE COLUMN AR_Report Type AS "Transaction Type" WIDTH 5
DEFINE COLUMN AR_Report Amount AS "Transaction Amount" WIDTH 12
  PIC "-9999999999.99"
Related reference
DEFINE VIEW command


(C) 2013 ACL Services Ltd. All Rights Reserved. | Send feedback