Tuesday, January 8, 2013

Characteristics of report sections in Crystal Reports


In all versions of Crystal Reports, a report consists of several sections such as the Page Header, Group Header, Details, Group Footer and Page Footer. In versions of Crystal Reports prior to version 5.0, all sections consist of complete lines; complete in that a section will never consist of a half line (for example, four lines and never four and a half).

In a new report, each section consists of at least one line. The default fonts for Fields and Text Objects determine the line’s height:

1. On the File menu, click Options.

2. Click the Fonts tab. You will see command buttons labeled Fields, Summary Fields, Group Name Fields, Text Objects and Field Titles.

When a text-based object is placed on a line, the line’s height is adjusted up or down so that the line is now high enough to accommodate that text-based object. If another text-based object is placed on the same line and its font size is larger than the first, the line’s height is again adjusted to accommodate the second text-based object. Thus, the text-based object determines a line’s height with largest font on the line. All text-based

Objects are positioned on a line so that their base lines will all line up on any given line. This means that a text-based object cannot be placed between lines; it must be placed on a line. Consequently, in versions of Crystal Reports prior to version 5.0, all text-based objects are bound to lines.



The screen shots above are from Crystal Reports version 8.5. The image on the left shows the Detail section with no objects inserted and a default line height of 12 points. When a database field is first placed on the report (center image), the line’s height does not change because it is the default line height (12 points). If the text-based object’s font size is increased from 12 to 16 points, the actual height of the object (boundary) increases.

If the line height increases to accommodate the larger text-based object, then the base lines of the two dissimilar font sizes will print on different lines. This is seen in the image on the right. If a second text-based object is placed on the same line as the larger 12-point object and the smaller font object’s height (boundary) matches that of the larger font, the baselines of the two dissimilar font sizes will match, thus printing on the same line.

As other text-based objects are added to the report, either by adding lines to the same section or by placing them in other sections, the vertical spacing or interline spacing, while controlled by Crystal Reports, is determined by the printer driver. Remember, the text metrics of a font determine interline spacing. This functionality makes it difficult to create reports designed to print on preprinted forms if the printer driver is going to change. For example, totals that used to print in the middle of a box might now print below the box because the new printer driver applies a greater value to interline spacing. Line by line, the text in the report will move down farther than when the report was first created.

No comments:
Write comments
Recommended Posts × +