ActiveReports 6 Online Help
Insert or Add Pages
Show AllShow All
Hide AllHide All

ActiveReports allows you to run multiple reports and combine their PagesCollections, or specified portions of them, into a single report. The document containing the merged reports can be saved to an RDF file or exported.

To add pages from one report to another

The Add method of the ActiveReports Document Pages Collection takes one parameter: value. The value parameter references a report document page. To add an entire report, use code like that in the example below to iterate through the entire pages collection of a report and append it to the first report.

  1. Add the ActiveReports viewer control to the Windows Form. For more information, see the Adding ActiveReports Controls topic.
  2. Double-click the title bar of the Windows Form to create an event-handling method for the form's Load event.
  3. Add code to the handler to add rptTwo to rptOne

The following example shows what the code for the Add() method looks like.

To write the code in Visual Basic.NET

To write the code in C#

To add a range of pages from one report to another

The AddRange method has two overloads, each with one parameter. The first overload takes an array of page objects, while the second takes a pages collection. Use the second overload to add an entire report's pages collection. Us the first (as in the example below) to append only specified pages from the second report onto the first.

  1. Add the ActiveReports viewer control to the Windows Form.
  2. Double-click the title bar of the Windows Form to create an event-handling method for the form's Load event.
  3. Add code to the handler to use the AddRange() method to add rptTwo to rptOne

The following example shows what the code for the AddRange() method looks like.

To write the code in Visual Basic.NET

To write the code in C#

To insert pages from one report into another

The Insert method takes two parameters, an index, which dictates where in the main report the pages are inserted, and value, the report page to insert.

  1. Add the ActiveReports viewer control to the Windows Form.
  2. Double-click the title bar of the Windows Form to create an event-handling method for the form's Load event.
  3. Add code to the handler to insert a second report at the beginning of the first

The following example shows what the code for the Insert method looks like.

To write the code in Visual Basic.NET

To write the code in C#

To add code to insert a page into a specified report location

The InsertNew method takes one parameter, index, which specifies the page after which you want to insert a new blank page.

  1. Double-click the title bar of the Windows Form to create an event-handling method for the form's Load event.
  2. Add code to the handler to insert a page into a specific report location.

The following example shows what the code for the InsertNew() method looks like.

To write the code in Visual Basic.NET

To write the code in C#

See Also

Related Sections