Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSRS Dynamically setting table position/location

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

like image 591
Jay Avatar asked Mar 22 '13 18:03

Jay


2 Answers

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.

like image 146
Ian Preston Avatar answered Nov 11 '22 11:11

Ian Preston


In Addition to Answer mentioned by Ian Preston, If Table 1 Does not have data, then we need write as follows:

=Parameters!HideTable.Value or IIF(countrows("Tablix1")<1,True,False)

Here, Tablix1 is First tablix name So that header would not appear in case of data unavailability in Table1

like image 21
Pankaj Todkar Avatar answered Nov 11 '22 12:11

Pankaj Todkar