Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 How to fix the position of controls (SSRS 2005)?

Author  Topic 

lneville
Starting Member

12 Posts

Posted - 2009-11-03 : 07:49:27
I am designing an invoice report. There are some controls at the top of the report (company logo, date, invoice number etc), followed by a table listing the items in the invoice, followed by some controls at the bottom (subtotals, returns address etc). The report should always print onto a single page.

I want the controls at the bottom to have a fixed position on the page. There is sufficient whitespace between these controls and the table above for the table to expand to list many items. However whenever it expands it pushes the lower controls down. This results in them spilling onto a second page.

Is there a way to fix the position of controls and suppress the "gets pushed down when controls above expand" effect?

lneville
Starting Member

12 Posts

Posted - 2009-11-05 : 06:25:48
I found a good solution using rectangles here: SQL Server 2005: Report Design Best Practices and Guidelines (http://www.microsoft.com/technet/prodtechnol/sql/2005/rsdesign.mspx)

Here's the relevant part (see underlining):
Using Rectangles to Keep Objects Together

Rectangles in Reporting Services can be used either as graphical elements or as containers of objects. As object containers, they keep objects together on a page and control how object move and push each other.

To keep multiple objects together on a page, put the objects within a rectangle. You can then put a page break before or after the rectangle by using the PageBreakAtStart or PageBreakAtEnd properties for the rectangle.
Using Rectangles to Control Item Growth and Displacement

Items within a rectangle become peers of each other and are governed by the rules of how peer items are positioned on the page as they move or grow. For example:

* Items will push or displace each other within the rectangle.
* Items will not push or displace items outside the rectangle, because they are not their peers.
* If necessary, a rectangle will grow to accommodate the items it contains.

You can use this logic to your advantage when dealing with objects that expand. For example:

* If you want to leave a blank space in your report for a table to expand into, group the blank space and the table in the same rectangle. When the table grows, it will push the blank space.
* If you want to prevent a matrix from pushing items off the right edge of the page, put the matrix within a rectangle with blank space to its right. Now, the matrix is no longer a peer to the other item on the page and will not be able to push it until the matrix can no longer be contained within its rectangle.

Go to Top of Page

JCirocco
Constraint Violating Yak Guru

392 Posts

Posted - 2009-11-05 : 07:19:03
Thanks for posting that. Definitely book marked now...

John
It's a small world (but I wouldn't want to paint it)
Go to Top of Page

vjimmers
Starting Member

6 Posts

Posted - 2010-11-23 : 15:04:57
<<Items will not push or displace items outside the rectangle, because they are not their peers.>>
I've seen this posted a number of places but it doesn't ring true.
There does not appear to be any way to completly control the matrix. It ALWAYS pushes controls outside the matrix, rectangle and list. No combination of lists inside of rectangles or matrix inside of rectangle inside of a list appear keep it from pushing objects outside the matrix. I've found no examples of actually controlling a matrix control. It aways pushes anything on the right and there does not appear to be any way of controlling it's width other than using groups and something like
=Ceiling(RowNumber("lst1_Period")/Parameters!ColumnsPerMatrix.Value)
It's basically guess work to get rid of the blank pages and I suspect will not work consistently with different datasets.
I'd love to see an example of side by side matrixes but I don't believe it is possible. If it was someone would have posted an example somewhere that could be googled.

<<If you want to prevent a matrix from pushing items off the right edge of the page, put the matrix within a rectangle with blank space to its right. Now, the matrix is no longer a peer to the other item on the page and will not be able to push it until the matrix can no longer be contained within its rectangle.>>

This sentence does not make sense. "until the matrix can no longer be contained within its rectangle"?
That is the whole point! So as long as you don't need to control it you can? ? ?

Go to Top of Page
   

- Advertisement -