1
votes

I have a report that contains a Tablix, which in turn contains multiple sub reports.

I need conditional page breaks between each page of the report, which I can achieve by adding a rectangle after the last sub report, within the Tablix. I then set the rectangle to have a page break at the end and make its visibility dependent on a parameter passed to the report.

This all works fine and I get page breaks between repeating sections of the report, however I end up with a blank page at the end of the report when the page break condition is true.

Is there a way to maintain the conditional page breaks but not have a blank page at the end?

My report structure looks like this:

<Report>
  <Body>
    <Tablix>
      <Rectangle>
        <Rectangle>
          <SubReport>1</SubReport>
          <SubReport>2</SubReport>
        </Rectangle>
        <Rectangle>
          <SubReport>3</SubReport>
          <SubReport>4</SubReport>
        </Rectangle>
        <Rectangle>Page break rectangle with conditional visibility</Rectangle>
      </Rectangle>
    </Tablix>
  </Body>
</Report>
2

2 Answers

0
votes

I managed to find a solution to this, although it isn't very elegant. I basically have 2 tablix controls (containing the same sub report data, bindings etc), each nested within its own rectangle. One with the page breaks between each instance of a group turned on, and one with this option turned off.

I then set the visibility of each parent rectangle based on a parameter, i.e. rectangle1 visibility = @PageBreak, rectangle2 visibility = !@pageBreak.

If anyone can suggest a more elegant solution I would be very interested.

Thanks.

0
votes

My solution,

only using tablix (no rectangle)...

add new parameter for the page break, ex: @PageBreak boolean or string, up to you.

Next, you can create group row in tablix, and set your group on to function, something like this: =IIf(Parameters!PageBreak.Value=true, Fields!YourGroup.Value, "")

then OK.

*you can delete the row or column that is created when you do this, without removing the group (remove row/ column only)

Next, find your group list (usually at bottom screen, Row Groups), and set properties Group -> PageBreak = Between

This will do.

Hope this help.