Previous Next

Enabling the User to Filter Data : Tutorial 3: Creating and using report parameters : Task 6: Create a report parameter that prompts for a vendor name

Task 6:

In this procedure, you create a report parameter that asks the user to select a particular vendor or all vendors for the products whose quantity in stock matches the user-specified value. You create a report parameter that appears as a list box, which displays all the vendor names.

1
2
3
1
In Name, type the following text:
RP_productvendor
2
Display products for this vendor
3
4
On New Parameter, List of value displays options for providing a list of values to the user, as shown in Figure 12‑16. The figure also shows the properties you have specified for the report parameter so far.

Figure 12-16 Properties for RP_productvendor report parameter

Figure 12-16
4
This option creates a list of values dynamically. BIRT retrieves the values from the data source when the report runs, which ensures that the values displayed are always current.
Under List of value, Data Set displays Products, which is the only data set created for the report so far.
5
1
2
Vendors
Choose Next.
3
select productvendor
from Products
4
Choose Finish to save the data set. Edit Data Set displays the columns you specified in the query, and provides options for editing the data set.
5
Choose Preview Results to confirm that the query is valid and that it returns the correct data. You should see the results that appear in Figure 12‑17. Notice that some vendor names are listed multiple times.

Figure 12-17 Data rows returned by the Vendors data set

Figure 12-17
6
6
1
2
3
7
1
2
8
Deselect Allow Duplicate Values. Remember that the Vendors data set returned some vendor names multiple times. Deselecting the Allow Duplicate Values option displays each name once in the list box.
Figure 12‑18 shows the complete definition of the RP_productvendor report parameter.

Figure 12-18 Complete definition of the RP_productvendor report parameter

Figure 12-18
9
10
In the layout editor, choose Preview. Enter Parameters appears, as shown in Figure 12‑19. The RP_productvendor parameter appears as a list box with the first value in the list selected by default.

Figure 12-19 Enter Parameters displaying both report parameters

Figure 12-19
Enter Parameters displaying both report parameters
11
View the values in the list box. The values are sorted in ascending alphabetical order, and there are no duplicate values.
Choose OK. The report output still shows all products because you have not yet bound the report parameters to the Products data set.

(c) Copyright Actuate Corporation 2008