[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Line shading Put a shade under a line
In this case, instead of shading specific lines based on the content of
the lines (see the last paragraph for information about this type of
shading), we have shaded every other line to simulate "green-bar"
shading. This type of shading improves the readability of dense,
single-spaced listings because it helps the reader distinguish one line
from another.
Like the column shading repon, this report uses shading characters and
zero line height to shade lines containing data fields. In addition, it
uses R&R's line logical feature to turn this shading on for alternate
lines.
To create this report, we followed the first five steps given for column
shading, then we continued with the steps outlined below:
1. To insert the shading characters, we moved down to the line below the
data fields and pressed Shift F3 to display R&R's extended character
screen. We moved the cursor to the lightest shading character,
pressed F3 to select it, and pressed F3 50 times to insert 50 of
these characters on the report layout. (If we had wanted the shading
to extend across the page, we could have filled the entire line, from
O to 8.5 inches.) Since the pitch of the font in which the shading
characters will print is the same as the ruler pitch (in this case,
10 characters per inch), the line of shading on the printed report
will start and stop exactly where the ruler line indicates.
2. As in the column shading report, we did not need to apply a font to
the shading characters, because a new4 entered text field is
automatically assigned the default font for the report -- in this
case 12-point lO-pitch Courier.
3. Again, we used the /Line Print Height command to manually specify
heights for the body lines on the report layout: 12 points for the
body line containing the data fields and O for the body line
containing the shading field. This forces the 12- point shading
characters to overprint and completely fill the line above them.
4. Next, we used the /Field Calculate Create command to create a feld
called SHADE to control printing of the shading line. Since we want
the shading line to print for every other record, we need a
calculated field expression that will return alternating true and
false values or, since numeric fields can serve as logical fields,
alternating zero and non-zero values. The expression for SHADE uses
R&R's MOD and RECNO functions to do just this:
MOD(RECNO(),2)
Used without a file alias argument, RECNO() returns the number of the
current composite record. The MOD function takes two arguments, a
dividend (in this case the value of RECNO) and a divisor (2), and
returns the remainder of the division.
Thus, the value of this expression in the first composite record of
the report will be MOD(1,2) or 1. The expression's value in the
second composite record will be MOD(2,2) or zero. The value in the
third composite record will be MOD(3,2) or 1, and so on. Since zero
is the same as a logical false value and one (or any non-zero value)
is a logical true value, this field can be used as a logical field to
control line printing.
5. After creating the SHADE field, we used the /Line Print Logical
command to make the value of SHADE control the printing of the
shading line.
When the value of SHADE is 1, the line with the shading characters
will print. When the value of SHADE is 0, the line with the shading
characters will not print.
6. Finally, as we did in the column shading report, we used the /Print
Preview command to preview the report before we printed it. We zoomed
in to make sure that the shading alternated as we intended and that
the shading characters filled the line without gaps or overlaps.
Note that the same technique could be used to highlight selected lines
of a report. In this report, for example, we could have shaded lines for
employees in a selected department or employees hired after a selected
date. In these cases, the expressions for the SHADE field might have
been as follows:
DEPT = nAdministration"
or
HIREDATE > = CTOD("O1/01/9O")
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson