34 Building a Ranking Report

In this chapter, you will learn about reports that rank data in different way. By following the steps in this chapter, you can generate the report output shown in Figure 34-1.

Figure 34-1 Tabular report output, ranked by number and percentage of customers

Description of Figure 34-1 follows
Description of "Figure 34-1 Tabular report output, ranked by number and percentage of customers"


You can create a report that ranks data by comparing it to a user-specified bind parameter. This enables you to rank data in different ways in the same report; for example, by count and by percentage. You can set the ranking criteria at runtime, or let them default to previously specified values.

Data Relationships

This report requires one query to fetch the data. To rank the data, you'll create the following objects:


This report uses a tabular layout style, with some modifications.

Example Scenario

In this example, you will create a report that displays the names and total purchases of your top three customers and the top 75% of all customers. Furthermore, you will allow end users of your report to set the ranking criteria (that is, the top x customers and the top y% of all customers) at runtime.

As you build this example report, you will:

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