Set report main list

Command group Flag affected Reversible Execute on client Platform(s)
Report parameters NO NO NO All

Syntax

Set report main list list-or-row-name

Description

This command specifies a list as the source for the data for the current report. When a report is printed, Omnis uses the main file specified either in $mainfile or the file set by the last Set main file command. Set report main list lets you override the main file setting by specifying a list, from which data is read for the next printed report.

A list-based report prints one record for each line in the list. The data file is not used unless the report contains auto find fields. Sorting, searching, subtotals, and so on, continue to work the same way as for file-based reports. All field values are taken from the list and records are read in list order.

When a Prepare for print command is encountered, the current list or file setting overrides the Main file setting used in the report parameters dialog.

Example

# Set the main list for the report rMyReport
Set report name rMyReport
Set report main list tMyList
Prompt for destination
Print report
# Alternatively, you can use notation to set the main list
Do $clib.$reports.rMyReport.$mainlist.$assign('tMyList')