Monday, March 19, 2012

Odd behavior (Pagebreaks & Visibility)

I built a report, that displays several Subreports. Then a request came, if it wouldn't be possible, to build a switch to turn on/off a page break after each report.

Since RS doesn't support a fexible page break controlling (you can either set or not set a page break hardcoded), I got an idea for a workaround:

After my Subreport I put a rectangle with a page break. Now every Subreport was displayed on a separate page.

Then I set the visibility for the rectangle to "hidded" and as expected, there was no page break after each subreport.

So far, so good. I then created a boolean parameter and set the Visibility expression to:

=Not Parameters!PageBreakAfterEachReport.Value

Now here comes the strange thing: If the Parameter is false, the rectangle is not displayed and therefor there is no page break, BUT, if the parameter is true, the rectangle is displayed correctly but there is STILL NO page break!!!?!?!!?!?

Why does the page break work, when I set the visibility hardcoded, but not when I try to control it via a parameter & expression?

I'm having the same issue here. If my control's visibility is dynamic, the pagebreaks do not work correctly. Is there any resolution/workaround to this problem?|||

Hi,

You could load the xml generated in XmlDocument and then using Xpath select the pagebreak element. Set this element dynamically.

Regards,

Alok

|||

Folks, I don't know if it is going to make you feel better or not, but apparently this behavior is "currently by design" -- at least I think that what is described in this thread is the same as what you are discussing.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=672379&SiteID=1

Actually (editing this post) now that I think about it, I may already have worked out a workaround that will work for this situation. Let me know what you think.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1682115&SiteID=1

In that post, I included a special dummy group and used a boolean parameter to determine the conditional page break. In your case, rather than the parameter, your condition would be something "if my other thing isn't visible, do this page break".

Hope this makes sense...

>L<

No comments:

Post a Comment