Print pages in specified order (Page1, Page2, Page1, Page2)

edited 3:12PM in FastReport .NET
Working with VB.Net (FR.Net) here and struggling to find a way to control the output page order for a report.

I have two pages:
1) Invoice
2) Statement (relating to the above invoice)

I need to "print" these pages in the following order:
Invoice1
Statement1
Invoice2
Statement2
Invoice3
Statement3

No matter what I try, the pages output as follows:
Invoice1
Invoice2
Invoice3
Statement1
Statement2
Statement3

Setting
Statement.Backpage = true
doesn't help me either, as the whole order goes out of whack and I end up with duplicates:
Invoice1
Statement3
Invoice2
Statement3
Invoice3
Statement3
Statement1
Statement2

Any help would be greatly appreciated!

Comments

  • Hello!

    Prepare a report for a single record in a loop using the append mode (Prepare(append: true)):

    For i As Integer = 0 To ids.Count - 1
      report.SetParameterValue(“InvoiceId”, ids(i))
      report.Prepare(i > 0) ' False on the first iteration, True on subsequent ones!
    Next
    report.PrintPrepared()
    

    Leave one ReportPage; bind a list of customers/invoices to its DataBand, and place the Statement inside that same DataBand as a nested SubreportObject (or ChildBand) with the StartNewPage property set to true.

This discussion has been closed.