Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

6.11 Handling Blank Sections

Example 6-1. Eliminating blank address lines.

A common problem with printing addresses is that each one can have a different number of lines. Every address has a line allocated for the street address, but some addresses need a second line for other miscellaneous information. This could be an “Attention:” comment or the suite number. If an address doesn’t use this second line, it appears as a blank line and messes up the formatting of the address. An example of these labels is shown in Figure 6-15.



Figure 6-15. Address labels with blank lines.

To fix this problem, create three sections. The first section has the addressee’s name and street. The second section only has the second address line. The third section has the rest of the address fields. To make the second section only appear when there is data in the second address line, set the formatting options Suppress Blank Section. If the second address line doesn’t have any information, the section isn’t printed and the blank line is eliminated. The labels in design mode are shown in Figure 6-16. The printed labels are shown in Figure 6-17.



Figure 16-16. Address labels in design mode.


Figure 6-17. Address labels that suppress blank sections.

Example 6-2. Adding non-blank sections.

If you can use sections to suppress blank lines, you can do just the opposite: use sections to show special information. For example, you may want a report to only print a section for unique circumstances. There are a multitude of examples on how to use this feature. An employee report could print a special note if an employee’s birthday falls within the current month. Invoices can print reminders to late customers that they need to pay or else penalties will be incurred. A recipe listing can print additional notes for favorite recipes. Each example benefits from using multiple sections because if the section doesn’t have any data to print, additional room isn’t allocated on the report.