Optionally hiding columns in Reporting Services

One of these things is not like the other. My customer was intensely interested in Inspector Gadget, and had a SSRS report to tell them all about it. So we have the three main characters that were selected as the “Character” parameter, and this parameter was multi-select:

Inspector Gadget
Penny
Brain

There was a column that shouldn’t be visible when only Brain was selected, but should be visible if all characters were selected, or if Inspector Gadget and / or Penny were selected. I don’t know why, I just work here, living in the 80s. To toggle on the visibility, I wrote this little piece of code. If the count of the parameters is three (all characters were selected), then set the “Hidden” property to “False”. Otherwise, determine if “Brain” was one of the selected characters, and if it was, set the “Hidden” property to “True” (hiding the column):

=IIF(Parameters!Characters.Count = 3, False, IIF(Join(Parameters!Characters.Value,”,”).Contains(“Brain”), True, False))

As always, serving your Inspector Gadget / SSRS needs.

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: