REPORT
Contents
Purpose
Generate a report as defined in a report format file
Syntax
REPORT FORM <.frm filename> | (<expC>)
[<scope>]
[FOR <condition>]
[WHILE <condition>]
[PLAIN]
[HEADING <expC>]
[NOCONSOLE]
[NOEJECT]
[PREVIEW]
[UNDERLINE]
[SEPARATE]
[SEPCHAR <expC>]
[SUMMARY]
[LPP <expN>]
[TO TERMINAL]
[TO PRINT]
[TO FILE <.txt filename> | (<expC>)]
See Also
@, ACC(), CALC(), CREATE REPORT, MODIFY REPORT, PRINT, SET ALTERNATE, SET DELETED, SET FILTER, SET PRINT, SET RELATION, TREPORT
Description
The REPORT command formats information from the active table, and any related tables, using the report format <.frm filename> set up with the CREATE REPORT Recital Terminal Developer development tool. The filename can be substituted with an <expC>, enclosed in round brackets, which returns a valid filename. The default <scope> for the report is to process ALL records, unless the WHILE condition is used, in which case the default is REST. You can report from more than one table by issuing the SET RELATION TO command, and using alias pointers in the expressions that you have specified. If SET FILTER TO is in effect, then only those records that satisfy the FILTER condition will be processed. If SET DELETED ON is in effect, then only those records that are not marked for deletion will be processed. If no file extension is specified in the FORM name, then '.frm' is assumed. If the report format contains group/subtotals, then the table must be either sorted, or indexed in group/subtotal order.
FOR <condition>
If the FOR clause is specified, then only those records which satisfy the specified <condition> will be processed.
WHILE <condition>
If the WHILE clause is specified, then processing will terminate when the specified <condition> is .F.. The WHILE clause can be used in conjunction with the FIND or SEEK commands, and the REST <scope> to restrict the records that are processed, and therefore optimize the performance of the command.
PLAIN
If the PLAIN option is specified, then the report is printed with the heading defined in the report format file, on the first page only.
HEADING
If the HEADING option is specified, then it will be printed on the top line of each page, in the center. HEADING accepts multiple lines of text that are separated by the ';' character.
NOCONSOLE
If the NOCONSOLE option is specified, the report will not be displayed on the screen when being sent to a printer or file.
NOEJECT
If the NOEJECT option is specified, then there will be no initial form feed output.
LPP
The LPP clause is used to specify the number of lines per report page. The LPP clause will override the page length specification in the report format file (.frm).
PREVIEW
If the PREVIEW option is specified, the report will be previewed on the screen.
TO PRINT
If the TO PRINT option is specified, the report will be output to the printer.
TO FILE <file>
If the TO FILE option is specified, then the report will be output to an ASCII text <.txt filename>. If no file extension is specified in the file name, then '.txt' is assumed. The file name can be substituted with an <expC>, enclosed in round brackets, which returns a valid filename.
TO TERMINAL
If the TO TERMINAL option is specified, then the report will be output in pages to the issuing terminal. The user will be prompted to press a key between pages.
UNDERLINE
If the UNDERLINE option is specified, then subtotal and total lines will be underlined.
SEPARATE
If SEPARATE is specified, then each report row will be separated from the next with '-' characters.
SEPCHAR <expC>
The SEPCHAR option allows you to specify a character <expC> to separate each column. If the "|" character is used for this purpose, together with the SEPARATE option to separate rows, the report will be generated with the appearance of a table with horizontal and vertical rules.
SUMMARY
The SUMMARY option can be specified to overwrite the summary flag as specified with CREATE REPORT. If this option is used, only headings, sub-headings, sub-totals and totals will be produced from the report.
Word wrapping of columns is implemented if the column expression is longer than the column width. MEMO fields are automatically word wrapped in the column. User Defined Functions (UDF) can be used as part of the column expression to create more complex reports. These must be active when the report is created as the Recital/4GL evaluates the column expression for syntax errors. If you need to calculate horizontal totals across each line of the report, the ACC() and CALC() functions can be used to provide this functionality (see the CREATE REPORT command for details). If the active table is indexed, then the Recital/4GL processes the records in the order of the master index file.
Example
use patrons index events report form patrons; for event = "BALLET" and date>date(); heading "BALLET PATRONS"; noeject; separate
Products
Recital Database Server, Recital Mirage Server, Recital Terminal Developer