Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically Insert Page Break in ActiveReports

I've been scouring the web for a good example, but cannot figure out how to add a page break to an ActiveReports report programmatically. The reports I'm working with usually require 1-2 pages for each record. In order to support dual-sided printing of the reports I want to insert a blank page for each record that uses an odd number of pages, ensuring that each new record is printed on the front of each printed page.

I'm very new to ActiveReports, so any suggestions, code samples, or links are much appreciated!

like image 265
Kevin Babcock Avatar asked Dec 23 '22 04:12

Kevin Babcock


1 Answers

There are two ways to do this and the best option depends on the data and your report.

Option 1: Page Break Control You can add the PageBreak control to the report in a specific location and programatically set the Enabled property of the PageBreak control to determine whether it creates a page break or not. See this page for documentation on the Enabled property of the PageBreak control:

Option 2: Section.New Page The other option is to use the NewPage property of the section. In this case you can set the NewPage property of the Detail or GroupHeader or GroupFooter section to trigger a page break. Try setting it from the Format event of the section. See this page for documentation on the NewPage property.

The support forums dedicated to ActiveReports support on the GrapeCity website are active and also a great way to get suggestions and help on ActiveReports.

Hope this helps!

EDIT : Links fixed

like image 184
Scott Willeke Avatar answered Jan 31 '23 07:01

Scott Willeke