Juan Velez
Juan Velez

Reputation: 741

SSRS - Prevent pagebreak in the middle of a row group

I have an SSRS report that gets exported to PDF and then printed on to paper. The problem I am having is that I am getting page breaks in the middle of a group.

I have MetricGroup - MetricSubGroup and Details. Those are my Row Groups.

I have several different MetricGroups in the report.

I need to make it so that my report will not break in the middle of a MetricGroup.

So right now I get lets say 2 metric groups and half of the 3rd metric group on page 1. Page 2 contains the second half of the 3rd metric group and so on.

I need SSRS to push a metric group to the next page if the metric group does not fit entirely on the current page.

Is this possible to accomplish?

Upvotes: 4

Views: 6271

Answers (2)

Glazius
Glazius

Reputation: 739

To elaborate a little more on the previous answer, specifying KeepTogether = true for any given tablix member will try to keep all elements of that tablix member together.

So if you specify KeepTogether on your MetricGroup tablix member, SSRS will try to keep all elements of that tablix group together, and when it fails because the report spans multiple pages, it will page break where it likes, resulting in groups breaking up over pages.

If, however, you specify KeepTogether on your MetricSubGroup tablix member, SSRS will try to keep all of the subgroups within a MetricGroup together, which will result in the parent MetricGroup trying not to break on a page if that were possible.

I'm spelling this out explicitly because there's a common degenerate case here - a report without any groupings but with a complex details tablix that generates with multiple rows per data record. Trying to specify KeepTogether on the details tablix will try to keep all of the details together, introducing unexpected page breaks.

In this case you'll need to generate a details group as the immediate parent of the details tablix and group by whatever the report identity is. Then you can specify KeepTogether on the details tablix and it will keep together only the members for one single data record.

Upvotes: 2

BIDeveloper
BIDeveloper

Reputation: 2638

You need to use the KeepTogether option - but bear in mind this is a "best endeavours" process - for instance, you couldn't keep two thousand rows together on one page.

Another approach is to force page breaks and certain parts of the report.

Upvotes: 5

Related Questions