开发者

How to avoid splitting row groups in microsoft reports?

I have a report here that each item is split in several lines, but about four can fit a single page.

My probl开发者_开发问答em is that MS Report is splitting the last one and I would like to keep the entire item on the page or skip it to the next page. Is there any automatic way to accomplish this?

I tried marking the "Keep together in one page if possible" option in the tablix properties, but no success with this.


I had the same problem as you, where my items each consisted of about 10 rows. I could show 2 full items per page, and I didn't want to split an item across pages. I solved this in the following way:

  1. I added a "Grouping" property to the objects making up the dataset for the report. This property is an integer with the value 0 for the first two items, value 1 for the next two items, and so on. In your case, you'd set it to 0 for the first 4 items and 1 for the next 4.
  2. In the .rdlc file for the subreport, I marked all the rows, right-clicked, and added a parent group. I set the "Group by" to the Grouping property of the tablix' dataset.
  3. This adds a column to the report, with the Grouping value. I removed this column but kept the grouping (The last of the two options, if I remember correctly).
  4. For this new group, I went to "Group properties" and added page breaks between each instance of a group.

This way, the first group consists of two items (both with grouping 0), then there's a page break. The next group has grouping 1, and then there's a page break and so on.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜