Show/Hide Column Header on Toggle in SSRS

Piyush Jain picture Piyush Jain · Aug 17, 2015 · Viewed 7k times · Source

I am working on a requirement that allow me to show columns when a user clicks on "+" (expand a row), and hides the column when a user clicks on "-" collapse a row.

So for example, when all rows are collapsed, report looks like:

enter image description here

When a user click on A to expand the a row in the report, then report should look like

enter image description here

Please note that COL4 only shows up when a row expands.

I have tried to set the visibility properties but the result I am getting like

enter image description here

If I am trying to set the header textbox properties getting an error like.

"toggle item must be the text boxes that share the same scope as hidden item or are in a scope that contains the hidden item, and cannot be contained within the report item unless current grouping scope has a parent"

I am Using Matrix Table

Answer

Daniel picture Daniel · Aug 17, 2015

The problem is that clicking on a Col1 toggle will only be able to hide elements contained within your table grouping (which doesn't include the header of your col2) and you will see the error you mention above, "toggle item must be the text boxes that share the same scope...".

You can place a textbox outside of your table area and that will be able to toggle the column visibility, but that would expand the values for all col1 one grouped values and will not be what you are looking for. Unfortunately you cannot do exactly what you are looking for; the best option is the one you show above.