Previous Next

Enabling the User to Filter Data : Tutorial 3: Creating and using report parameters : Task 10: Provide the option to select all vendors

Task 10:

The query and the design of the report parameters require the user to specify a minimum stock quantity and a specific vendor. The report displays only products with the specified minimum stock quantity and for the selected vendor. In this procedure, you provide the user with the option of selecting all vendors, so that the report displays all products—supplied by any vendor—with the specified minimum quantity. To provide this option, you modify the RP_productvendor report parameter to display an All Vendors value, and to send the appropriate value to the query.

1
2
On Edit Parameter, under List of value, choose Static. This option lets you create user-defined values, whereas the dynamic option does not.
The properties under List of Value change to reflect the change from dynamic to static values.
3
1
Choose Import Values. Import Values displays the first data set in the report, Products, and the values of the first field in the data set, PRODUCTNAME.
2
In Select Data Set, select Vendors.
3

4
Choose >> to import all values from the field.
Figure 12‑24 shows the selections you make in Import Values.

Figure 12-24 Import Values, showing the data set field values to import

Figure 12-24
Import Values showing the data set field values to import
5

Figure 12-25 Edit Parameter displaying the values that appear in the list box

Figure 12-25
Edit Parameter displaying the values that appear in the list box
4
1
2
1
In Display Text, type the following text:
All Vendors
2
In Value, type the following character:
%

Figure 12-26 Definition of a new value

Figure 12-26
In SQL, % is a wildcard character that matches any sequence of characters. When the user selects All Vendors, the WHERE clause in the Products query is updated as:
WHERE ...
and productvendor Like %
This query returns all rows with any productvendor value.
3
On Edit Parameter, the new value appears at the bottom of the Selection values table.
5
1
2
3
6
1
Under Sort, in Sort by, select Value Column. This sort displays All Vendors at the top of the list in the list box because the value % appears before A.
2
3
7
8
1
Choose Preview. Enter Parameters appears, as shown in Figure 12‑27. All Vendors is the first value in the list, and this value is selected by default.

Figure 12-27 Enter Parameters displaying the updated vendor parameter

Figure 12-27
Enter Parameters displaying the updated vendor parameter
2
o
For the first parameter, type the following number:
500
o
Choose OK.
The generated report should look like the one shown in Figure 12‑28. The report displays products, supplied by any vendor, where the quantity in stock is less than or equal to 500.

Figure 12-28 Report displays rows that match the specified report parameter values

Figure 12-28

(c) Copyright Actuate Corporation 2008