Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I force a report to always insert a page break?

I created a report in Visual Studio 2012 that has two report definitions. The main report section repeats once per vehicle, and it has a subreport that repeats once for each delivery that vehicle has.

The main report design looks as follows:

enter image description here

The orange bar on the left side indicates that the rectangle on which I have all the other elements located is selected.

I have set the following properties on it:

enter image description here

I have also set Add a page break before and Add a page break after on the Tablix that contains the other elements:

enter image description here

There is no other Rectangle or Tablix on this report design.

My problem is that it doesn't always do a page-break before and after. On pages with only a little information, it puts each vehicle on the same page, as follows:

enter image description here

But when a vehicle is longer than a single page, it spills into the next page, and the next vehicle does not add a page break before it, like so:

enter image description here

How can I force the report to always insert a page break before a new vehicle?

like image 913
Gustav Bertram Avatar asked Nov 29 '13 09:11

Gustav Bertram


1 Answers

Maybe these links could help you.

Goodluck!

  • How to add a page break (Report Designer)
  • How to: Set Page Breaks (Visual Studio Report Designer)
  • Defining Page Size and Page Breaks in a Report (Visual Studio Report Designer)

Update by original poster

Reading all the instructions on the previous pages, I found the a solution. My main report tablix needed to be grouped into individual rows, and those row groups needed page breaks.

To add a page break to a grouping in a table

  • In Layout view, click the table so that column and row handles appear above and next to the table.
  • Right-click the row handle on the right side of your row group Tablix, go into the Row Group submenu, and then click Group Properties....
  • The Tablix needs to be grouped by the rows you want page breaks between. On the General tab, add a Group on expression. In my case, it was VehicleID.
  • On the Page Breaks tab, click Between each instance of the group
  • Click OK
like image 157
Paramone Avatar answered Oct 03 '22 21:10

Paramone