How to Merge DevExpress XtraReport

I had to combine two different DevExpress reports into one. Since they have completely different layouts like when you're merging an invoice with a shipping label So, using a Subreport just didn't work for my needs.

After digging through the docs, I discovered that DevExpress allows us to easily merge multiple XtraReports together. following example code

Note: DevExpress XtraReport doesn't actually have "pages" until you call the CreateDocument(). If you have page object, so you can call Add() or AddRange()

Other Consideration

  • Continuous Page Numbering: By default, merging pages this way might restart page numbering for the second report. If you want continuous numbering (e.g., Page 1 to 10), you may need to adjust the PrintingSystem.ContinuousPageNumbering property.
  • Memory Management: When you move a page using Pages.Add(), the page is physically moved, not copied.
  • Print Settings: The merged report will generally follow the paper size and orientation settings of the first report. Ensure both reports share the same page dimensions for a professional look.

Reference


Discover more from naiwaen@DebuggingSoft

Subscribe to get the latest posts sent to your email.