21 Building a Report that Suppresses Labels

In this chapter, you will learn about reports that suppress the display of field labels. By following the steps in this chapter, you can generate the report output shown in Figure 21-1. Notice how the field labels for Department 40 do not display because no detail records were found

Figure 21-1 Suppressed labels report output

Description of Figure 21-1 follows
Description of ''Figure 21-1 Suppressed labels report output''

Concepts

A default master/detail report must print a detail label or field, even if there are neither fetched detail records nor values for user-created columns. This example demonstrates how to suppress the detail information for a single record, but allow the other master/detail records to display.

Data Relationships

  • This report uses a master/detail data model. You will also create a formula column in the detail group whose sole function is to return a value; this ensures the detail group contains at least one column that will always return a value each time a detail record is returned (as opposed to, for example, a null value).

  • You will create a summary to count the number of times this formula column returns a value. In the layout, you will create a format trigger that references the summary to determine if the detail labels should be displayed. Doing so provides a reliable method for determining the existence of detail records.

Layout

This report uses a Group Above layout style with modifications.

Example Scenario

In this example, you will build a report that does not display field labels when there are no detail records. Instead, text displays that notifies the user that no detail records were retrieved.

As you build this example report, you will:

To see a sample report that suppresses labels, open the examples folder named suppresslabels, then open the Oracle Reports example named suppresslabels.rdf. For details on how to open it, see "Accessing the Example Reports" in the Preface.