Reputation: 1
Is it possible to expand collapse all grouped items on SSRS Report builder like in example on the page below: https://www.sqlchick.com/entries/2010/9/19/expand-or-collapse-all-grouped-items-on-ssrs-report.html but without using parameters and without go to report action with this new parameter?
I was trying with variable in report but I couldn't find a way how to make a button from textbox so I could for example toggle this variable by =Variables!MyVariable.SetValue("1")
when the button is clicked.
Upvotes: 0
Views: 739
Reputation: 21703
There are few ways to do this depending on if you want to be able to expand/collapse a single column at a time or all columns.
In this example, using some sample city geography data, I created a simple table with cities, then a country group and then a continent group, in both cases I chose to include a group header, all standard stuff.
To expand both the country and cities levels (Continent was set to visible and therefore always shows), I added a textbox, changed its name to ToggleAll
so it's easier to identify.
The report design looked like this.
Then I right-clicked the CountryDesc
group, then Properties then set the visibility to hidden and set the toggle object to ToggleAll
I then repeated this on the Details
(Cities level) row group.
When the report first runs, it looks like this...
Notice how the "Toggle All" button has a +
as SSRS recognises it controls visibility.
With a single click of this textbox, the report expands to this..
If you wanted to expand single levels, you could do a similar thing but use the textbox that contains the column header to control visibility. It's easier if you rename the textboxes before you do this to something easy to find in drop downs lists (e.g. hdr_Country
)
Upvotes: 0