Home Devices
New Blog Posts: Merging Reports - Part 1 and Part 2

Combining reports with SetReportProperty

edited November 2007 in Devices
Hi, I'm using D2007 Win 32/ ReportBuilder 10.06

I have a MasterReport with a SubReport on the detailband and wants to load
different reports into the SubReport runtime. I need to do it in a pbChild
style to prevent the subreports starting a new page.

I'm using this code in the master report detailband BeforePrint:

SubReport.SetReportProperty(GetMySubReport(jitPipe.recordindex));

With the MasterReport.Detailband.PrintHeight = phDynamic and
SubReport.PrintBehavior=pbChild

This works fine when the subreports fit into one page, but hangs when it
spans over to the next page (Previewer never finish calculating the next
page).
For the record: the subreport previews fine by itself, so it shold not be a
terminating problem.

Any ideas?

Carl

Comments

  • edited November 2007

    Rather than changing the subreport.Report while the application is running.
    Prior to calling Report.Print, create a separate Subreport instance for each
    report layout that you need to print. Then use Band.BeforePrint to set the
    subreport.Visible property for each subreport.

    (I think the other approach is prone to what you are experiencing.
    Band.BeforePrint will fire when the subreport generates on the first page
    and it will fire again, when it overflows. which means that you are again
    setting up the subreport and it is starting over, thus infinite generation.)



    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.