Monday, April 27, 2009

Expand Collapse columns in a table SSRS

Problem:
How to make columns collapsible, expandable in a table Sql server reporting services.

Solution:
I asked to some people, how to do this, lot of people proposed me to use matrix. But my data is simple data and has 14 columns like first name, last name, state, city, zipcode, q1, q2, q3, h1,h2, h3 etc… I need to display the columns q1, q2, q3; h1,h2,h3 expansible and collapsible. By default when user see the report, i need to show only first name, last name, state, city, zipcode, q1, h1 columns. But the q1, h1 columns with expand, collapse symbols. When any one clicked to expand i need to show the other columns like q2,q3, and same for h2, h3.
Below is the solution what I have followed to make it work. I didn't use any matrix here, only tables.

  1. Select all the columns that you want to make expandable, collapsible.
  2. Hit F4 [Properties window] –> Select Visibility, and in that, set these values, Hidden = true and ToggleItem = ID of the textbox [Where you want to show the Expand[+], Collpse[-] symbols that text box id. in other words parent text box id.]
  3. That's it. A simple solution to the issue.

3 comments:

  1. for Expand Collapse columns in a table SSRS , i had set the toggel id with the textbox id , and hiden = true , while viewing the report , the column in not visible , adn i dont find any expandable symbols....gave u give me the exact solution
    Thanks in advance
    PYP VYAS.

    ReplyDelete
  2. Same problem. I do not see an expand/collapse symbol. Time to Google an answer.

    ReplyDelete
  3. I was just experimenting with this and that happened to me when I accidentally set the toggleItem to the row I wanted to inflate/deflate instead of the parent group.

    ReplyDelete