In some cases, it is desirable to have the user select a high level category in order to limit the number of parameter choices a user sees. For example, let's say we were looking at a report where a user needed to look at products. In the case of a large company, there could be thousands of possible products or product codes. It is better to filter based on a product line to find the actual products one is looking for. Using the Classic Cars example, we have many different types of car models such as the 1969 Harley Davidson Ultimate Chopper, Dodge Charger, and 1948 Porsche 356-A Roadster. If we want to limit what is displayed, we limit our parameter display by product lines such as Classic Cars, Motorcycles, or Vintage Cars. Once a user has selected one of these, they would see only the vehicles under the corresponding product lines. These are called cascading parameters.
Let's look at an example. In this report, we are going to modify the Employee-Chapter6.rptDesign
report we created earlier to allow for a drop-down parameter list that allows a user to select a manager and list the employees who are under the manager, and then select an employee and get the report for that employee.
Employee-Chapter6.rptDesign
. Employee-Cascading-Chapter6.rptDesign
. dsprmEmployeeID
. dsEmployeeManager
and enter the following query:SELECT employeenumber, lastname || ‘, ‘ || firstname employeeName, (SELECT lastname || ‘, ‘ || firstname FROM EMPLOYEES managerEmployees WHERE employeenumber = currentemployee.REPORTSTO ) managerName FROM EMPLOYEES currentemployee union all SELECT employeenumber, lastname || ‘, ‘ || firstname employeeName, ‘All' managerName FROM EMPLOYEES currentemployee
rcprmEmployeeManagers
as the parameter name. dsEmployeeInfo
and double-click to open the Data Set Editor. dsprmEmployeeID
, and click the Edit button. rprmEmployee.
Now, when we run the report, we will have two new parameters. When we select the Manager drop down, the second list will get smaller. So, if we select All, then all of the employees will appear in the second drop-down list. Change the Manager drop-down option to something else and the list of employees changes.