Hi,
Is there any way I can select all the values in a list control while I am on the report viewer. I am able to do that in report designer however not in the report viewer.
Sure ..
1. Create a table with one column and two records: Column name= "Selection_Options" values:{"Custom", "All"}
2. Add this table to your report designer
3. Create a new report section for our test
4. Create a prompt container
3. Drag two: Drop-Down and List controls in the prompt container
4. In the Drop-Down, drag and drop the column from our new support table "Selection_Options"
5. Create a character based parameter "Selected_Option"
6. Assign this parameter to the drop-down so that it picks up the value of our selection from the drop-down
7. In your main table, create a calculated item "List_calculated_var", and make it like:
If ('selected_option'p = 'Custom') then List_variable /* List_variable is the one you want to assign to the list, so that it populate the list with all the values for selection */
else if ('selected_option'p='All') then "All" /* In this case "List_calculated_var" will only have one value "All".
8. Create a character list based parameter "Selection"
9. Now to your list control in the prompt container, assign "List_calculated_var" as category and "Selection" as Parameter
10. Now you have a parameter "Selection" having either "All" or "Custom" values and you can use this parameter in other controls ..
hope it helps ..
It doesn't "select all" directly but you can subset the list data by another control's parameter .. try using drop-down + list control combination to subset the selection list ..
Can u give me an example
Sure ..
1. Create a table with one column and two records: Column name= "Selection_Options" values:{"Custom", "All"}
2. Add this table to your report designer
3. Create a new report section for our test
4. Create a prompt container
3. Drag two: Drop-Down and List controls in the prompt container
4. In the Drop-Down, drag and drop the column from our new support table "Selection_Options"
5. Create a character based parameter "Selected_Option"
6. Assign this parameter to the drop-down so that it picks up the value of our selection from the drop-down
7. In your main table, create a calculated item "List_calculated_var", and make it like:
If ('selected_option'p = 'Custom') then List_variable /* List_variable is the one you want to assign to the list, so that it populate the list with all the values for selection */
else if ('selected_option'p='All') then "All" /* In this case "List_calculated_var" will only have one value "All".
8. Create a character list based parameter "Selection"
9. Now to your list control in the prompt container, assign "List_calculated_var" as category and "Selection" as Parameter
10. Now you have a parameter "Selection" having either "All" or "Custom" values and you can use this parameter in other controls ..
hope it helps ..
Thanks that works
I've dutifully followed your instructions until I got to step 9, then I got "This report object does not support parameter assignment."
I'm using SAS VA v7.3 and it looks like I can't add a parameter to a list object? Are there any other options for me to "select all" and "clear all" in a list control?
you can right click in list control and "Select All" or "Select None" ..
didn't know that the list control in 7.3 doesn't have parameter role .. in 7.4 it does ..
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.