Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Report items affecting each others positions in SSRS 2008

I'm having trouble with some report items changing other items' positions when they are conditionally hidden.

I've been using Reporting Services 2000 for printing item price labels as PDFs, with the report consisting of a single table with a single cell for each item. The data fields and other items on the label are all placed inside a single rectangle. Because of the very specific layout required, some of the report items overlap in the designer in order to position correctly on the rendered PDF.

This has worked fine for several years, until we upgraded to SSRS 2008 and I had to migrate the report to the new version.

Now, suddenly, when certain items on the report are hidden (by an expression in the Hidden-property), certain other items shift their positions. In some cases, even the containing rectangle is resized.

After quite a bit of googling, I've come to the understanding that SSRS 2008 attempts to maintain the relative spacing between report items, so that if an item to the left of another one changes in size, the item to the right is adjusted accordingly.

Apparently, hiding an item equates to changing its size to zero, and so the item next to it is shifted left to fill the gap.

However, I do not want this behavior, since all items should stay in their predefined positions regardless of others.

So, does anyone know of a way to "fix" report item positions, so that they are not affected by hiding other items?

I've tried placing the items inside separate rectangles so as to group them, in the hope that only items inside the same rectangle can affect each other, but this does not seem to help.

Any ideas would be greatly appreciated.

like image 914
Rolf Avatar asked Apr 06 '11 11:04

Rolf


2 Answers

In the side by side example, you can place the control that may be hidden into a rectangle big enough to hold both; but then put the other control that must stay in a fixed position BEHIND the rectangle (i.e. the parent of this control is the report rather than the rectangle).

If that's not enough, and the hidden and non-hidden items use the same dataset, you could (shudder) use a giant tablix control with a grouping of =1 and the right number of rows and columns to control the layout (because you can insert rectangles inside).

Some other tricks are to set the color/backgroundcolor properties to white (though in some rendering formats you can click and drag to highlight and still read what was there)... alternately you can go so far as to make the contents of controls all expression based, so as not to produce anything if a condition is met, and so it's basically invisible.

like image 124
Cody Konior Avatar answered Nov 07 '22 16:11

Cody Konior


Another approach: create rectangles containing the fields you want to hide, then put a WHITE line across the entire bottom (or top) of the rectangle. This keeps the rectangle the same size even if the fields within it are hidden. A rectangle will shrink if the fields within it shrink, but the line spanning the entire rectangle prevents this from happening.

like image 39
Ted Kennedy Avatar answered Nov 07 '22 17:11

Ted Kennedy