I\'ve created a report in SSRS with two report parameters. I\'d like the second to update it\'s values based on the selection in the first. The first is a list of sales agen
This works automagically if you order your parameters and datasets correctly
WHERE clause in the datasets to make the dependencies correct across parameter variablesThis will work if your WHERE clause in the second and subsequent datasets have variables that SSRS knows are populated from earlier parameters.
As an example, I have three datasets from the venerable pubs database (sample in 2000).
pubslist is used to populate the @p parameter, and looks like this:
select pub_id, pub_name from publishers
titleslist populates the @t parameter, and looks like this:
select title_id, title from titles where pub_id = @p
Finally, reportdataset looks like this:
select title, price, ytd_sales from titles where title_id = @t
The order of the parameters in the Report | Report Parameters menu is crucial; because the datasets must be executed in the order shown above, and the @t parameter is in a dataset that relies on the @p parameter being set first, we move @p to the top of the list.
Now, SSRS evaluates the dataset needed to fill the dropdown for the first parameter with labels. It relies on a dataset that doesn't need a parameter, so can be produced immediately.
Then, having got that parameter value, it can populate the second parameter's dropdown. That in turn results in the report being produced.