REPORT command
Concept Information
Formats and generates a report based on the open Analytics table.
Syntax
REPORT <ON break_field <PAGE> <NODUPS> <WIDTH characters> <AS display_name>> <...n> FIELD other_fields <WIDTH characters> <AS display_name> <...n> <SUPPRESS> <NOZEROS> <LINE n other_fields> <PRESORT <sort_field>> <...n> <SUMMARIZED> <SKIP n> <EOF> <TO {SCREEN|PRINT|filename <HTML>}> <IF test> <WHILE test> <FIRST range|NEXT range> <HEADER header_text> <FOOTER footer_text> <APPEND>
Parameters
Name | Description |
---|---|
ON break_field PAGE NODUPS WIDTH characters AS display_name <...n> optional |
The character field or fields used to break the report into sections. A new report section and subtotal is created each time the value in break_field changes. Breaking reports into sections can make them easier to scan.
Note You must specify ON to use break_field , PAGE, NODUPS, or PRESORT. |
FIELD other_fields WIDTH characters AS display_name <...n> |
The fields to be included in the report.
The SUBTOTAL and ACCUMULATE keywords are synonyms for FIELD, and have been deprecated. All numeric fields are automatically subtotaled. Note Break fields are automatically included in the report and do not need to be specified as other_fields. |
SUPPRESS optional |
Excludes blank detail lines from the report. |
NOZEROS optional |
Substitutes blank values for zero values in the field. For example, if a report includes a large number of zero values in a field, the report is easier to read if it only displays non-zero values. |
LINE n other_fields optional |
Specifies the number of output lines in the column and the fields to appear on the line number n. If no value is specified, the column defaults to a single line. The value of n must be between 2 and 60 inclusive. Column headings on the report are determined solely by the fields on the first line. other_fields specifies appropriate fields or expressions for the report. |
PRESORT sort_field <...n> optional |
PRESORT does not sort the fields listed as other_fields unless they are also listed as sort_field. |
SUMMARIZED optional |
Produces a report with subtotals and totals only, and no detail lines. Subtotals are generated for the unique break field values. If SUMMARIZED is not specified, Analytics produces a report that includes detail lines, as well as subtotals for each of the specified key break fields. |
SKIP n optional |
Inserts blank lines between detail lines in the report. n must be an integer specifying the number of lines to insert. For example, SKIP 1 produces a double-spaced report. |
EOF optional |
Execute the command one more time after the end of the file has been reached. This ensures that the final record in the table is processed when inside a GROUP command. Only use EOF if all fields are computed fields referring to earlier records. |
TO SCREEN | PRINT| filename <HTML> optional |
The location to send the results of the command to:
By default, reports output to a file are saved as ASCII text files. Specify HTML if you want to output the report as an HTML file (.htm). If you omit TO, the report is output to screen. |
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. |
FIRST range | NEXT range optional |
The number of records to process:
Use range to specify the number of records to process. If you omit FIRST and NEXT, all records are processed by default. |
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. |
APPEND optional |
Appends the command output to the end of an existing file instead of overwriting it. Note You must ensure that the structure of the command output and the existing file are identical:
Analytics appends output to an existing file regardless of its structure. If the structure of the output and the existing file do not match, jumbled, missing, or inaccurate data can result. |
Examples
Generating an HTML report
You generate a report from the Ar table and output the report to a formatted HTML file:
OPEN Ar
REPORT ON No FIELD Due Type Amount TO "C:\Reports\AR.htm" HTML