7.5 Creating a New Visual Report

The following sections describes how to create a visual report. The process of defining a visual reportfile is the same whether the report is being created using rptedit, wtrdef or through a menu choice selection within toolkit.

The first report we will create is very simple. For our example, we will be using the demonstration database, named demo, that is distributed with the C/Base system. Recall that the demonstration application maintains a small magazine subscription database. This application requires an RMSfile to contain subscriber names and addresses, an RMSfile to contain all magazines that a subscriber may receive and a third file to keep track of the subscriptions for each of the subscribers. These RMSfiles are demo~sub, demo~mag, and demo~script. The first report we will create is a listing of each magazine's code, title, annual subscription rate, and number of subscribers. In order to begin, enter:

c:\> rptedit -c demo~mymag

and press RETURN. (Note: It is assumed that a logical reportfile does not exist for demo~mymag). Once this has been done, a Report Description form is displayed like the one shown below.


The Report Description form is used to enter the report attributes in much the same way data is entered into C/Base formfiles. Within this form, however, some of the function keys are used slightly differently. Their functions are as follows:

Key Function


<F2> Unused

<F3> Unused



<F6> ADD



The GOLD key <F1> serves the same purpose as the function, or gold key on a calculator. The GOLD key <F1> followed by another key gives the second key a new function. For example, when you press the D key, the normal action is entry of the letter D into the current field at the location of the cursor. However, if you press the GOLD key <F1> and then the D key, the new action is the DELETE function.

The extra GOLD functions that are active with the Report Description form are very similar to their counterparts used in the C/Base data entry forms. They are:

Key Sequence Function




<F1> R REFRESH Screen

<F1> 4 CLEAR Screen

Pressing the GOLD key <F1> and then the H key gives you access to the on-line help facility.

Pressing the GOLD key <F1> and then the X key allows you to cancel a current function (e.g., UPDATE or ADD). Using the CANCEL function while in UPDATE mode restores the original contents of the Report Description form. Using the CANCEL function while in ADD mode clears all of the form fields. After using the CANCEL function, the form is returned to a no-mode state.

Pressing the GOLD key <F1> and then the D key deletes the contents of the currently displayed Report Description form.

Pressing the GOLD key <F1> and then the R key 'refreshes', or 're-paints', the screen. This is useful should extraneous characters be displayed on the screen.

While in ADD or UPDATE mode, pressing the GOLD key <F1> and then the 4 key clears all of the form fields.

As noted, the function keys <F2> and <F3> are not used within the Report Description form.

If a Report Description has already been stored, it may be changed by pressing the UPDATE key <F4>. This moves the cursor to the first entry field and allows changes to be made.

Pressing the UPDATE key <F4> when the UPDATE function is currently active restores the contents of each field of the Report Description form to their original values.

After all of the changes are made, the STORE key <F5> must be pressed to record the changes.

Pressing the ADD key <F6> allows you to enter information to a new Report Description form. When the add function is invoked, the cursor moves to the first entry field on the form, and the new description can be entered. The entry fields at the bottom of the form are filled with values. These are the default values for the report attributes and may be changed, provided that the values entered are valid entries for those fields.

After you have entered the new Report Description, the STORE key <F5> must be pressed to record it.

The SWITCH key <F7> is used to display the first Report Section of the report. (Note: This function only works when a Report Description has been defined.) Pressing the SWITCH key <F7> a second time re-displays the Report Description form.

Although you won't use the EXIT function until you are finished designing the report, pressing the EXIT key <F8> would write the visual reportfile and return you to the system prompt.