Reputation: 1
Usually we design the table to have x number of rows and y number of columns in a report. But how can we create a report which adds the rows and columns dynamically at run time based on the result of the stored procedure?
For example, student A has sponsored student sdf and student B has sponsored two student as shown in below table. So, I need to add dynamically new member name (nm_name) and new member id (nm_id) columns in matrix or in table.
+-------+-----+-------+---------+-------+-------+
| St_id | Name| nm_id | nm_name |nm_id | nm_nme|
+-------+-----+-------+---------+-------+-------+
|1 | a | 5 | sd | 8 | fgf |
|2 | b | 39 | bgj | | |
|3 | c | 78 | fhf | 2 | 2 |
+-------+-----+-------+---------+-------+-------+
I want above report layout in SSRS.
Upvotes: 0
Views: 633
Reputation: 8892
What I understand from your explanation is that you want to add the 3 columns dynamically, But SSRS
doesn't allow adding the column at the runtime
for that you can use the trick as below,
1) Add three(whatever number of columns you need) extra columns in your existing matrix
2) Then set there visibility expression depending upon when you want to show the columns
3) As You mention that if sponsored by some other student then show the column so your expression can be
= IIF(Fields!studentsponserd.value ,False,True)
This way you can set the visibility of the columns and this will be visible according to your expression condition. AS I am not sure what is your particular condition I am not able to give you the correct expression. The expression might need to tweek as per your need. You can see this blog for more.
Upvotes: 1