Reporting Services Tips and Tricks > Formatting Tips > Can I let the user hide various columns at run-time?

Search the FAQ for entries containing:

The answer is "Yes". Occasionally users may want to hide certain columns on a report but rather creating a separate report for these types of reports I simply give the users the option to hide columns or not. The easiest way to do this is to utilize the Boolean parameter to hide or show the column. Here is a report which, by default, displays the product number.

I then create a Boolean parameter entitled HideProductNumber as seen below.

The beauty of the Boolean parameter will be seen in the next few steps. You then click on the product Number column and go to Properties.  Go to the Visibility section under the Hidden property. Due to the fact that this property is already a True/False you can simply place the parameter into the Expression editor under this property.  And since we made the True result to hide the column we just use the parameter as-is in the Expression editor.

Then when you run the report and choose the True option under the Hide Product Number parameter you see the result where the Product Number disappears. 

If you choose the False option the Product Number re-appears.

If you want multiple columns to be hidden you could create more parameters associated with each column you want to hide.

Last updated on July 11, 2009 by Bob