DEFINE VIEW command

Defines a new view or overwrites an existing view.

Syntax

DEFINE VIEW view_name <RLINES n> <ALL> <SUPPRESS> <SUMMARIZED> <IF test> <WHILE test> <HEADER header_text> <FOOTER footer_text> <TO report_file_name <HTML>> <OK>

Parameters

Name Description
view_name

The name of the view to create or overwrite.

Note

View names are limited to 64 alphanumeric characters. The name can include the underscore character ( _ ), but no other special characters, or any spaces. The name cannot start with a number.

RLINES n

optional

The line spacing for detail records in views and reports. By default, detail lines are single spaced.

ALL

optional

All fields in the active Analytics table layout are added to the view.

SUPPRESS

optional

Suppresses blank detail lines in reports generated from the view. When the report is generated the blank detail lines will be omitted from the output. This option applies to reports based on multiline views.

SUMMARIZED

optional

Specifies that reports generated from the view should include subtotals and totals, but not include the detail lines.

The subtotals are generated based on the break fields defined in the view. If this option is not selected, the report includes detail lines, as well as subtotals for each of the specified break fields.

IF test

optional

A conditional expression that must be true in order to process each record. The command is executed on only those records that satisfy the condition.

Note

The IF parameter is evaluated against only the records remaining in a table after any scope parameters have been applied (WHILE, FIRST, NEXT).

WHILE test

optional

A conditional expression that must be true in order to process each record. The command is executed until the condition evaluates as false, or the end of the table is reached.

Note

If you use WHILE in conjunction with FIRST or NEXT, record processing stops as soon as one limit is reached.

HEADER header_text

optional

The text to insert at the top of each page of a report.

header_text must be specified as a quoted string. The value overrides the Analytics HEADER system variable.

FOOTER footer_text

optional

The text to insert at the bottom of each page of a report.

footer_text must be specified as a quoted string. The value overrides the Analytics FOOTER system variable.

TO report_filename HTML

optional

The filename and type for reports created from this view.

Use the HTML keyword to save reports generated from this view as HTML files (.htm). By default, generated reports are output as ASCII text files.

OK

optional

Deletes or overwrites items without asking you to confirm the action.

Examples

Creating a view

You open the Ar table and create a view called AR_Report, which includes all of the fields in the table layout:

OPEN Ar
DEFINE VIEW AR_Report HEADER "AR Report" ALL OK