My Twitter

twitstamp.com
Web Analytics

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.

.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • email
  • FriendFeed
  • LinkedIn
  • NewsVine
  • Reddit
  • Twitter

12 comments to Managing Reporting Services Layouts using the Rectangle in SSRS

  • guest

    Nice post. You explained in detail what I couldn't understand only by reading Books Online.

    Thanks.

  • JerseryNo10

    You are a life saver, Thanks for the tip!

  • Luke Hayler

    ‘Life saver’. I like that. ;)
    You’re welcome!

  • Fareeth Ahamed

    Great, The Beware tip helped me, thanks a lot, any chance we could set the rectangle be in fixed height no matter what the conent inside it shrinks or grows

    • Luke Hayler

      Hi Fareeth,

      Glad you noticed that little gotcha. As far as I am aware, you cannot fix the size of the rectangle through properties. You can however, fix the minimum height/width of the rectangle by placing a line item at the point at which you want to constrain the rectangle. This is a bit of a work around, but will get what you want. I don’t believe you can set a maximum size constraint on the rectangle though.

  • David

    Can you force the rectangle to always take up the space that it is give? I have a report that prints in thirds of a page. Main is top 1/3, then a subreport for the middle and another subreport at the bottom 1/3. I have the subreports placed correctly and they move when I move the rectangle but the bottom 1/3 starts printing directly below the middle section rather that at its designated location.

    • Luke Hayler

      Hi David,

      As per the comment just above yours….

      You can force the rectangles to a certain size, as long as that size is bigger than the object which it contains. It’s a bit of a hack but, place line object on the right-hand extreme and one on the bottom extreme. Make these Lines transparent to hide them when the report renders. The lines will limit how much the rectangle auto-sizes and will ensure that the rectangle holds its intended shape.

      With regard to printing; See this post about sizing your page correctly

  • Was thinking exactly the same, cool site, thanks.

  • Jim

    Hi Luke,

    First let me thank you for giving back to the community! Not many people take the time these days to help others, so thanks! ;-)

    I am new to the SSRS thing as I have always Crystal Reports, but this time I do not have that option. I have read the latest iteration of SSRS is very powerful, but I cant even get some of the simplest things to work right.

    When using the Report Builder it only allows you to save to the “.rdl” extension. Can Report Builder 3.0 save to “.rdlc”? Can “.rdl” be converted to “.rdlc”?

    The “Interactive Page Size” and “Page Size” properties for a blank report specify the standard letter size of “8.5×11″. However, the “Body” section of the report defaults to “6×2.25″. I really dont understand the purpose or implications of this, nor do I understand “Interactive Page Size” versus “Page Size”

    I am sure all of this info is buried in many places on the web, but your succinct explanation of your initial post leads me to believe that you could boil this all down to a simple answer.

    Thanks Luke!
    Jim

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>