Blaise
Blaise

Reputation: 22202

How to create an SSRS report with dynamically populated columns?

I am using SSRS Report Builder.

My query returns permits for each user:

user1   permit1
user1   permit2
user1   permit3
user2   permit2
user2   permit4
...

How can I create a report like this?

USER    PERMITS
------------------------------------
user1   permit1   permit2   permit3
user2   permit2   permit4
...

Or even better:

USER   PERMIT1   PERMIT2   PERMIT3   PERMIT4
-----------------------------------------------
user1     x         x         x
user2               x                   x
...

The difficulty is that the column "Permit" is not a group of set values. We will add new permits and remove frequently.

Thanks for any assistance.

Upvotes: 1

Views: 1424

Answers (1)

Jeroen
Jeroen

Reputation: 63699

You're looking for the Matrix Control. In this control you'll group rows on the first (user) column, and group columns on the second (permit) column. In the cell you can check the value of the permit, and if it's set you plot an 'x'. Schematically the control will look like this:

 ---------+-----------------------------------------------
|         | [Permit]                                      |
|---------+-----------------------------------------------
| [User]  | =Iif(Fields!Permit.Value Is Nothing, "", "x") |
 ---------+-----------------------------------------------

Upvotes: 1

Related Questions