Chapter 8 - Advanced Formatting Techniques
Once you've mastered the basics of creating reports, it's time to learn some of the finer points of report design. Crystal Reports gives you numerous formatting options for printing report sections for specialized purposes. For example, you can create specialized reports such as labels or multi-column reports. You also have the option of creating multiple sections within a report and format each section individually. This one feature gives you an almost unlimited number of ways to make a report fit different scenarios and customize it for individual users. The first part of this chapter covers how to format Sections to create professional reports for any circumstance. You are given lots of creative examples of how to use Sections in real world reports.
Using Multiple Report Sections
Throughout this book, when different parts of a report were discussed, they were referred to by their section name. For example, when adding an object to be displayed in the header of a group, the portion of the report would be called the Group Header section. But what you weren't told is that each section is actually contained in an Area. Areas let you build more complex reports. Simple reports don't require working with Areas so they weren't mentioned. But in this section, you'll see that Areas are actually a container for one or more sections and you'll see how to use them to create advanced report formatting.By default, when you create a new report, each area is composed of a single section. There is an area for the Report Header, Page Header, Details section, etc. Every section is contained inside a single area. This initially gives you a one-to-one relationship between areas and sections.
Crystal Reports lets you create dynamic reports by adding multiple sections within an area and format each section independently of the other. This changes the relationship between areas and sections to a one-to-many relationship. One area can have multiple sections within it. You have the option of displaying all the sections or you can use conditional formatting to set which sections are visible and which ones are suppressed.
Note |
---|
An area can have more sections added to it, but the sections must be of the same type. For example, the Details area can have two Detail sections in it, but it can't have a Group Footer section in it. |
An example of multiple sections is shown in Figure 8-8.
Figure 8-8. Multiple detail sections.
In this example, there are two sections between the group header and footer: Details a and Details b1. Each section is part of the Details area. The benefit of having two sections within the same area is that it gives you a lot of flexibility for formatting the report. Creative use of multiple sections solves many reporting problems.Before seeing how to work with multiple sections, you first have to understand the rules. The first rule is that multiple sections are printed consecutively. The first section (labeled with the ‘a') prints first. The ‘b' section is printed second, and so on. The second rule is that you can change the formatting of any section and it doesn't effect the formatting of the other sections. A section can be suppressed or have its background color changed and this has no effect on the other sections within that area.
Multiple sections can be inserted, deleted and merged with other sections. When you right-click on a section header, you get the menu shown in Figure 8-9.
Figure 8-9. Menu for managing sections.
When selecting Insert Section Below, it inserts a new section below the section that was clicked on. Select Merge Section Below to combine the current section with the one below it. Crystal Reports merges the two by taking all the objects in the lowest section and copying them to the section above it. All the new objects go underneath the existing objects. Select Delete Section to delete a section from the report.
To read all my books online, click here for the Crystal Reports ebooks.