7.5.1 Entering a Report Description

To enter a new Report Description, press the ADD key <F6>. This places the form in ADD mode as shown in the following screen:


The default values for the report attributes Page Length, Page Width, First Line, and Last Line are displayed in their appropriate entry fields, and the cursor is on the Data File Name field, which is the first entry field. The remainder of this section describes each of the fields of the Report Description form and how they affect the printed report, as well as the entry which must be made in our example.

Each visual reportfile reports on data from a single C/Base RMSfile. This RMSfile is named in the Data File Name field. A check is made on the RMSfile to ensure that the RMS dictionary file can be opened for processing. Opening the RMS dictionary file requires that the pathname for the RMSfile or the name for the full logical RMSfile is known.

The order in which the records of the RMSfile are reported may be altered by sorting. This is done by specifying from one to three data field names in the Sorted By entry fields. All the records are sorted by the first Sorted By field. If you specify a second Sorted By field and there are records whose first sort fields are equal, they are sorted by the second sort field. Similarly, if you specify a third Sorted By field and there are records whose first and second sort fields are equal, they are sorted by the third sort field. If the Sorted By fields are left blank, the data records are reported in the order in which they appear in the RMSfile.

The three columns of fields labeled Field Name, Condition, and Value indicate the record selection criteria. You can use record selection to produce a report containing only the data records which meet these criteria. Examples of this feature might be a report of active customers or customers who are due for service.

The first of these fields, Field Name, is used to enter the name of a data field contained within the RMSfile which was specified in the Data File Name field.

The second field, Condition, indicates the type of comparison to be made between the value of the data field specified in the Field Name field and the value assigned in the Value field. This can be any one of the following:

Condition Test Performed

EQ equal

GE greater than or equal to GT greater than

LE less than or equal to

LT less than

NE not equal

The third field, Value, assigns a test value to compare with the value of the actual data field. Values can be the name of another field in the report RMSfile, a shell variable name preceded by a dollar sign ($), a number, or a string 'delimited' by the double - quote character ("string").

Leaving the selection criteria blank causes all of the records in the RMSfile to be included in the report.

The default values of the print attributes are set for printing on standard letter-size (8 1/2" x 11") paper. If you want to print your report on a non-standard paper size, the following values must be changed.

The value of the Page Length field controls how many print lines there are on each page, including the blank lines that are skipped as margins at the top and bottom of the page.

The value of the Page Width field controls the maximum number of print columns the report can use across one print line. (Note: 1 print column = 1 character.)

The value of the First Line field sets the top margin for the page. As each new page begins to print a certain number of blank lines are 'printed' by the printer in order to advance it to the line number where the report is actually to begin printing. The number of blank lines 'printed' at the beginning of each page is one less than the value specified in the First Line field.

When the line number indicated by the Last Line field is printed, the page footing is then printed and the paper is advanced to the top of the next page. This means that there must be enough lines left at the bottom of the page being printed to print the footing. The value of the Last Line field must be less than or equal to the Page Length field minus the total number of footing lines. (Note: Page footings are explained in subsequent sections of this chapter.)

With the Report Description form displayed as depicted earlier, the fields should be filled in as shown below.


The only input required for our 'simple' report is the name of the report's RMSfile, mag. After making this entry and pressing the STORE key <F5>, the form is cleared and the Report Section screen is displayed.

It is important to realize that an RMSfile must be known by file pathname or logical RMSfile name. In our example, we use the logical RMSfile mag, without clarifying the database name. For a logical file to be identified, the database name and logical name must be known. A logical file name can explicitly name the database or it can be determined by the environment variable DBASE. It is assumed in our example that DBASE is set to demo. As an alternative solution, you could use the full logical name demo~mag. For more information regarding logical file names, see Chapter 2, Databases.

One advantage of using only the logical name without the database name is that this same report could be used with a similar database which maintains the same logical RMSfile (in this example mag). By changing the database name of DBASE, this one report could then be run with several different databases.