23 Building a Conditional Form Letter Report

In this chapter, you will learn about reports that generate different versions of a form letter based on changing conditions. By following the steps in this chapter, you can generate the report output shown in Figure 23-1 and Figure 23-2.

Figure 23-1 Conditional form letter report output, base version

Description of Figure 23-1 follows
Description of "Figure 23-1 Conditional form letter report output, base version"

Figure 23-2 Conditional form letter report output, alternate version

Description of Figure 23-2 follows
Description of "Figure 23-2 Conditional form letter report output, alternate version"


Data Relationships

This report uses one query to select all data.


This report uses the Form Letter layout style. You'll also create the various pieces of boilerplate that will comprise the letter. To govern the printing of these boilerplate objects, you'll use vertically collapsing anchors and PL/SQL format triggers to conditionally produce different form letters for employees who meet the specified criteria.

Example Scenario

In this example, you will create a form letter to invite all of your employees to the company picnic. For your top sales representatives, though, you also want to include a special invitation to a dinner party in the form letter. For all other employees, you want to include a thank you without the dinner invitation.

As you build this example report, you will:

To see a sample conditional form letter report, open the examples folder named condform, then open the Oracle Reports example named condform.rdf. For details on how to access it, see "Accessing the Example Reports" in the Preface.