REPORT command

Used to format and generate ACL reports.

Syntax

REPORT <ON> {break_field <NODUPS> <PAGE>} <...n>  {FIELDS|SUBTOTAL} other_fields 
<SUPPRESS> <NOZEROS> <LINE n other_fields> <SUMMARIZE> <SKIP n> <EOF>
<TO {SCREEN|filename|PRINT}> <IF test> <WHILE test> <FIRST|NEXT range>
<HEADER header_text> <FOOTER footer_text> <APPEND> 

Parameters

ON break_field

The ON keyword can be omitted unless you are using the NODUPS parameter.

NODUPS

Specify this parameter to substitute blank entries for repeated values in the column. For example, if the customer name is listed for each invoice record, it can make the report more readable to list only the first instance of each customer name.

PAGE

Specify this parameter to insert a page break each time the break_field value changes.

FIELDS | SUBTOTAL other_fields

Specifies the fields in

SUPPRESS

Specifies that detail lines that are blank should not be included in the report, and the blank detail lines will be removed from the report.

NOZEROS

Specifies that blank values should be substituted for zero values in the report. For example, if a report typically includes a large number of zero values in a column, it can make the report more readable to display only the items that have a non-zero value.

LINE n other_fields

Specifies additional output lines. n can be a value between 2 and 60. The fields to appear on line n should follow n. The column headings on the report are determined solely by the fields on the first line. The other_fields parameter specifies appropriate fields or expressions for the report.

SUMMARIZE

Produces a report with subtotals and totals only, and no detail lines. The subtotals are generated based on the key break fields selected in the view. If this option is not selected, ACL produces a report that includes detail lines, as well as subtotals for each of the specified key break fields. Default: Include detail lines.

SKIP n

Inserts blank lines between detail lines in the report. n must be an integer specifying the number of lines. For example, SKIP 1 produces a double-spaced report.

EOF

Optional. Specifies that the command is executed one more time after the end of the file has been reached. This parameter is sometimes necessary to ensure that the final record in the table is processed when you are processing the records with a GROUP command. It should only be used if all fields are computed fields referring to earlier records.

TO SCREEN | filename | PRINT
  • Specify TO SCREEN to display the results in the ACL display area. This is the default output if the TO parameter is not specified.

  • Specify TO filename to save the results to a file. You must specify the filename value as a quoted string with the appropriate file extension. For example, specify the .TXT file extension to create a text file.

    For example: TO "Output.TXT"

    You can also specify an absolute or relative file path to save the file to an existing folder.

    For example: TO "C:\Output.TXT" or TO "Results\Output.TXT"

  • Specify TO PRINT to send the results to the default printer.

IF test

Optional. Specifies a condition that must be met. The command is executed on only those records that meet the condition.

WHILE test

Optional. Specifies that the command is executed only while a condition is true. The command processing terminates as soon as the specified condition evaluates as false, or the end of the table is reached.

FIRST | NEXT range

Optional. Specify FIRST to start processing at the first record or NEXT to start processing at the currently selected record. Use the range value to specify the number of records to process.

HEADER header_text

Optional. Specifies the text to insert at the top of each page of a report. The header_text value must be specified as a quoted string. The value overrides any value set for the ACL HEADER system variable.

FOOTER footer_text

Optional. Specifies the text to insert at the bottom of each page of a report. The footer_text value must be specified as a quoted string. The value overrides any value set for the ACL FOOTER system variable.

APPEND

Optional. Specifies that command output is appended to the end of an existing file instead of overwriting it. When using this parameter, you must ensure that the structure of the command output and the existing file is identical, if maintaining a consistent file structure is important (for example, when you are appending data to an existing ACL table), because ACL appends output to an existing file regardless of its structure.

Example

The following example generates a report from the “Ar” table and outputs the report to a formatted HTML file.

OPEN Ar
REPORT ON No FIELDS Due Type Amount TO "C:\AR.HTM" HTML


(C) 2015 ACL Services Ltd. All Rights Reserved.