[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Boxing memo's        Boxing Word-Wrapped Fields (intro)

 R&R-s line-draw feature enables you to insert line and corner characters
 on report layouts to draw boxes around text and data fields. As long as a
 field prints on a single line, the procedure is simple: insert horizontal
 lines with left and right corner characters on the lines immediately above
 and below the field, and then insert vertical line characters to the left
 and right of the field, in line with the corner characters.

 However, the technique illustrated above doesn't work when word-wrap
 format causes field data to extend beyond a single line. Since the number
 of lines that the word-wrapped field will occupy usually varies from
 record to record, you cannot simply insert additional lines with
 additional vertical line characters on the layout to create the sides of
 lhe box. A record in which the word-wrapped data requires two lines will
 need two lines with vertical line characters, while a record in which the
 data requires three lines will need three lines with vertical line
 characters. No matter how many vertical lines you use, some records end up
 with vertical gaps in the box and some with blank lines within the box.

 This article explains two techniques for drawing boxes around word-wrapped
 fields. Both techniques involve calculating how many lines will be
 occupied by the word-wrapped field and then using a calculated field to
 produce the variable-length vertical lines that make up the two sides of
 the box. The difference between the two techniques is how accurately and
 how quickly they calculate the number of lines occupied by the field.

 The first technique is a quick-and-dirty approach that uses calculated
 fields to determine the approximate number of lines the field data will
 occupy. The technique is approximate since, in calculating the number of
 lines, R&R considers only the length of the data in the field. It does not
 take account of the space added to the field when word-wrap leaves blank
 space at the end of lines. Thus, while this technique has the advantage of
 being simple and speedy, it may underestimate the number of lines required
 by your field, especially if the field is not very wide.

 The second technique is a more complicated method that uses user-defined
 functions to calculate exact how many lines the field will occupy. This
 technique does account for the space added to fields by word-wrap, but in
 order to do so, it uses three complex user-defined functions, two of which
 are recursive. Thus, while this technique will always produce an accurate
 count of the number of lines required by a word-wrapped field, it does so
 at the expense of performance.

 So that you can decide which technique suits your reports, we present them
 both here, followed by an explanation of how to create a calculated field
 that produces a variable-length vertical line and how to use this f.eld on
 your report layout.

 Note that these techniques will work only for word-wrapped character (not
 memo) fields and only if these fields and the line/box characters that
 surround them are printed in a fixed-width (not proportional) font that
 has an integral (not fractional) pitch.


This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson