0
votes

I'm using SSRS 2008 R2, and currently designing the report in the Design Surface in BIDS (visual studio).

I'm trying to make a really flexible report, and want to be able to choose fields based on a parameter - can this be done?

Below is an example of my current report:

enter image description here So for instance i have a parameter for Column1, Column2, Column3. And by choosing a different value in the parameter my tablix will automatically change it's field's for each column to those selected in the parameter - is this possible?

Many thanks. Jacob

1
Yes it is. Have a multi value select paramater with all of the column names. Then based on what they select, set the visibility of the column. FYI, if they export the report, all of the columns will be visible in the export file.SS_DBA
Building on @WEI_DBA's comment: Depending on the number of columns and their relationship you may want to consider creating display groups in your list of parameters to hide/show multiple columns with one selection.SMM
Just in case it is useful, you can also reference a field in the alternative notation. =Fields(Fields!FieldNameColumn1.Value).ValueRoss Bush

1 Answers

0
votes

you could use a expression with switch like for column1

=switch( Parameters!Column1.Value="Item_description",  Fields!Item_description.Value,
 Parameters!Column1.Value="Item", Fields!Item.Value)