0
votes

I have seen some mind-binding situations with SSRS reports in my few years of using it, and I've been able to design around most issues and get it to do everything I've been asked to do.

But apparently, not something extremely simple!

I'm using Visual Studio 2019 version 16.7.2 with the Microsoft SQL Server Reporting Services Designers version 15.0.19124.0 installed. There's no data bound to the report, this is just a simple design concept.

I have a report that has a static custom page size (in centimetres), interactive size and no margins (12.8 x 17.8cm). The body size is deliberately set to make it a two page report (2 x the page height).

'ConsumeContainerWhiteSpace' on the report properties is set to true.

Page 1 has an image, consuming the entire space of Page 1 (size of 12.8 x 17.8), with a Text box placed near the bottom right of the image (overlaying it, but not exceeding the width or height of the page, and is set to not grow).

Page 2 is exactly the same, with the content starting where Page 2 would and should start (0, 17.8). However, the Page 2 content is set to hidden (hidden = true, on both the image and the textbox).

When previewed, the report renders two pages, one of which is blank.

If I take the Page 2 content textbox off, and preview it, the report renders as one page (as I need it to).

The same issue occurs if I replace the textbox with a Rectangle or Tablix (the two objects I really need to use in this report as well as the textbox located where it is) and set them to hidden.

Moving any of these objects to the top of Page 2, still results in the same behaviour.

It seems that certain objects, despite being hidden, have space allocated that can't be 'rolled up / truncated / shrunk'. Is this 'by design behaviour'?

Is there some form of magic-witch-craftery I'm missing here to get this to work, or simply something I'm not understanding... ?

Thanks for reading!

Note: So far I have tried the 'Switch to inches, then back to centimeters' solution mentioned in other posts along these lines, have varied 'Keep together' properties, checked 'CanGrow' and 'CanShrink' property changes - all of which have not helped find a solution.

1
This is likely a product of the items overlaying each other, but is hard to determine without any screenshots of your design. In these situations I usually set the various elements to have brightly different and contrasting background or border colours to see where their bounds are in the rendered preview. It is also worth noting that the various render options (Preview. HTML, Excel, PDF, Image, etc) also all render slightly differently, so whilst your preview may be incorrect, the rendered PDF (for example) may be correct. - iamdave
@iamdave Page 1 renders perfectly, with everything in place, exactly where it should be. An exported PDF mirrors what I see in the Preview, in both cases. In outline view, as you say, there's a different rendering, where the components don't appear overlayed, but that's as expected. - VorTechS
Page 2 is likely not rendering as you expect due to overruns that are spilling out of the set page area. - iamdave
I'm willing to concede that is likely the case. In fact, now the preview is doing exactly the same thing just with the two images. - VorTechS
It isn't really a matter of conceding and I am not saying that is definitely the problem. If you highlight the individual report items per my comment above using backgrounds or borders you will be able to see definitely whether or not the issue is overruns. - iamdave

1 Answers

0
votes

The report body should be set at most wide enough to fit on your output page and long enough to hold all your report items. When you want different items to appear on a new page, put them in a container with a page break set either before or after (whichever is most appropriate). This can also be handled in a data driven manner using page breaks on table groups.

There is no requirement to have white space within your report design to 'fill up' the rest of the page on the rendered report.

If you want anything to appear at the bottom of the report, simply put it in the footer section. If you want specific things to appear at the bottom of the page of different heights on different pages, that is more of a challenge and will usually require some clever data driven spacers within the report body.