How do I force a report to always insert a page break?
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 clickGroup Properties...
. - The Tablix needs to be grouped by the rows you want page breaks between. On the
General
tab, add aGroup on
expression. In my case, it was VehicleID. - On the Page
Breaks
tab, clickBetween each instance of the group
- Click
OK
Related videos on Youtube
Gustav Bertram
I'm an engineering manager and software engineer with about 18 years of web dev experience. When I'm not writing code and learning more about Agile, DevOps and Lean, I hack Common Lisp for fun. My favorite tools are Emacs, a nice big whiteboard, and the Microsoft Sculpt Ergonomic Keyboard.
Updated on June 30, 2022Comments
-
Gustav Bertram almost 2 years
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:
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:
I have also set
Add a page break before
andAdd a page break after
on the Tablix that contains the other elements: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:
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:
How can I force the report to always insert a page break before a new vehicle?
-
bonCodigo over 9 yearsI am using 2010 VSRD. Is it possible to access and set the pagebreaks (by groups, by row number) programmatically and count total number of pages per report?