Reputation: 165
I have dropdown parameter with multi-values allowed. In my report header I want to show all the dropdown values that were checked by the user to run the report. But since there could be a couple of hundred values I want to show 'ALL' when all the values are selected instead of listing them one by one. How can I do that?
Thanks,
Upvotes: 0
Views: 1882
Reputation: 1745
You can do this if you read the list of parameter values from the database, you can then use a query to get the number of options.
Edit the parameter, set "List of Values" = Dynamic
Add a Command in the Database Expert to get your option count, something like:
SELECT COUNT(DISTINCT option) optCount FROM optTable
Then, building on CodeByMoonlight's suggestion, use a formula:
If UBound({?MyParameter}) = {Command.optCount} THEN "ALL"
ELSE Join({?MyParameter}, ', ')
Upvotes: 0
Reputation: 12538
If this is a static list, you can do something like this :
If UBound({?MyParameter}) = @ValueCount Then 'All' Else Join({?MyParameter}, ', ')
where @ValueCount is the number of possible values for the parameter.
If the number of possible parameters is varying between executions, then PowerUser's subreport method is one option.
Upvotes: 0
Reputation: 11791
Maybe you could feed the results into a subreport which would count the total # of values available vs selected. If they are equal, then it would return "All".
Upvotes: 1