Command group Flag affected Reversible Execute on client Platform(s)
Reports and Printing YES NO NO All

Syntax

Print report ([Ask for job setup][,Use search][,Do not finish others]) {instance-name (parameters)}

Options

Ask for job setup If specified, the command opens the job setup dialog
Use search If specified, the command uses the current search to select data
Do not finish others If not specified, all reports in progress are terminated before the new report is started

Description

This command prints the specified report instance to the selected output. You specify the report instance name and you can add a list of $construct parameters for the report instance. The default instance name is the name of the report class itself.

Subtotal sections are printed whenever the sort fields change value, provided that the fields entered in the Sort Fields dialog have Subtotals set to True.

You specify sort fields and the main file or list as part of the report parameters. If the main file has not been set in the report class, the current main file is used. You can override all the parameters in the class using the appropriate commands, for example, Set left margin.

Print report does not use the current record buffer but a special memory buffer to load in and sort records. Thus Print report does not affect Prepare for mode and does not lose current records. If the report is printed from a list, data is read directly from the report main list, as specified in the parameters for the report. LIST.$line is unaffected.

The Ask for job setup option opens the job setup dialog that lets you select the number of copies, paper trays, the printer, and so on, for the current print job.

All records are printed unless the Use search option is specified. In this case, only the records matching the current search class are printed. It is not necessary to use Prepare for print before Print report.

The Do not finish others option allows multiple reports to be in progress at the same time. If this is unchecked (the default) all reports in progress are terminated before the new report is started, which is compatible with earlier versions of Omnis.

The flag is cleared if the report is cancelled before completion by the user or in the event of an error. Most errors will display a message but will not cause Omnis to Quit all methods.

Example

Set report main file {fAccounts}
Set report name rMyReport
Clear sort fields
Set sort field fAccounts.Surname
Send to screen
Print report