Sections
Sections are used to determine where report objects will appear on a report. Each section has a different purpose and different rules that it follows to determine when and where it should appear on a report. For example, the Report Header section only appears at the top of the first page of a report. It does not appear on any other pages in the report. Although each section follows certain rules, there are many options available for customizing a section so that the report comes out just right. This section of the book shows you the different formatting options available as well as how to add sub-sections to a report for greater customization.
Formatting Sections
Report sections have many formatting options. You can hide a section, force it to print at the bottom of the page, force a page break afterwards and many other options. Creative use of these formatting options gives you control over how the report looks.
The formatting of each section is controlled by a single dialog box. The Section Expert, shown in Figure 6-4, is accessed by right-clicking on the report designer and selecting Format Section.
Figure 6-4. The Section Expert dialog box.
The Section Expert lists every section in the report and the formatting options available. The formatting options are represented by checkboxes because they are either enabled or disabled. Beside each option is a formula button that sets whether the option is enabled or disabled. This gives you flexibility for setting when a formatting option is turned on because the formula can use data from the currently printing record. Every time a section is printed, the formula is evaluated and its result determines whether the formatting option should be applied. This is described in more detail in Chapter 7.
When selecting the section from the list on the left, the formatting options on the right that are applicable to that section are enabled and the other options are grayed out. The list of formatting options doesn’t change, but you are prevented from choosing the ones that don’t apply.
With .NET, you can also access section properties via the Properties Window of the IDE. When you click on a section header, the properties in the window change to match the section selected. Each option shows whether it is enabled (True) or disabled (False). The drawback of using the Properties Window is that it has the limitation of not being able to use the advanced functionality of the Formula Editor.
Table 6-1 lists the different formatting options for sections.
Table 6-1. The formatting options for sections.
Formatting Option | Description |
---|---|
Hide (Drill-Down OK) | Don’t show the section, but allow the user the drill-down into the data. |
Suppress (No Drill-Down) | Don’t show the section. Drill-down is not allowed. |
Print at Bottom of Page | Force the section to always print at the bottom of the page. |
New Page Before | Force a page break before the section prints. |
New Page After | Force a page break after the section prints. |
Reset Page Number After | Reset the page number counter back to 1 after the section prints. |
Keep Together | Keep the section together on the same page. |
Suppress Blank Section | If there is no data in the section, do not print it. |
Underlay Following Sections | Print the current section on top of the following sections. Proper alignment is critical so that objects don’t overlap each other. |
Format with Multiple Columns | Creates mailing labels and newspaper column style reports. This is only listed for the Details section. |