Managing Reporting Services Layouts using the Rectangle in SSRS

Left a bit, right a bit

When it comes to designing one page summary dashboards for print (A4), you need to be able to ensure that the layout of your report is constant. Even with fluctuating columns & rows – care of Tables & Matrices. Initially this sounds fairly simple, add the report items, lay them out according to the design requirement and off you go. Preview. Whoa. WTH!

The problem arises when position of items on the report is affected by the growth of either a table or a matrix, either on the horizontal or vertical axis. Specifically, if the top one of your report items (the chart in Fig 1.) is below the bottom of another item (that can grow vertically), then it will be pushed out at run time. See fig 2.

Fig 1. The Design time Layout

Fig 1. The design time layout

Fig 2. The Runtime Layout

Fig 2. The run time layout

Have no fear, the rectangle is here!

Enter the simple rectangle report item. By using rectangles to layout your report and group certain items, you can retain the layout you worked so hard to achieve. How does it does this? The rectangle groups report items within itself, i.e. the growth of tables & matrices are relative to the rectangle and not the page itself. By adding two rectangles to the report I have grouped the Pie chart title and the pie chart, and have isolated the table. The table’s rectangle is also extended to the approximate depth of table at run time, thus ensuring that the planes of the report items relative to the design surface (the two rectangles) are the same.

Let’s have a look at the difference from Fig 1. & 2. In the Figs. below.

Fig 3. The design time layout using the rectangle report item

Fig 3. The design time layout using the rectangle report item

Fig 4. The runtime layout using the rectangle report item

Fig 4. The run time layout using the rectangle report item

But beware…

One important bit of information. You must ensure that the report items you wish to control are placed ‘into’ the rectangle. What I mean here, is that you cannot simply place a rectangle object over the report items you wish to constrain – this will give rise to overlapping objects and may result in error. The trick is to either place the rectangle on the design surface first and then drag-and-drop report items ‘into’ it, or for existing report items, place the rectangle onto the design surface and then cut the report items you wish to constrain, select the rectangle, and then paste the report items ‘into’ it. You can test that the report items are ‘inside’ the rectangle by selecting it (the rectangle) and moving it. If the report items (inside the rectangle) all move together, you have constrained them correctly.

Another note. The rectangle will not stop the growth of the tables & matrices, what it does is ensure that the layout of the rest of the report items are not thrown out at run time.

The data in the report is from the AdventureWorks database and is for illustration purposes only.

.