SSRS Dynamically setting table position/location

Jay picture Jay · Mar 22, 2013 · Viewed 8.6k times · Source

I see in Report Builder / design mode, there is a Position and Location property that allows you to set how far from the top or left the table should appear.

My question is, is there a way to set 2 or more tables in the same location (ie top of the page 0 from top, 0 from left) without having them stacked on top of each other in design mode / report builder?

Is there a way to dynamically set that position property?

For instance, here is a sketch of a report in report builder:

top of page
---------------------------
Table 1 (hide)            |
                          |
                          |
                          |
Table 2 (show at top)     |
                          |
                          |
                          |
                          |
                          |
                          |
                          |
---------------------------

bottom of page

Answer

Ian Preston picture Ian Preston · Mar 22, 2013

The location properties for Tablix members are not expression based. However, you can show/hide objects within a report based on a parameter, and this can affect the position of other report items. A simple example:

A report with a Header, two Tablix members and one parameter, HideTable:

enter image description here

The Hidden property for the top Tablix is set to =Parameters!HideTable.Value, i.e. the parameter toggles whether it's displayed. With this setup and layout, SSRS automatically shifts the second Tablix to the top of the report Body when the first Tablix is hidden. See below:

enter image description here

enter image description here

So it's not quite a dynamic location, but by using other features you can achieve the same functionality as above.