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

Dynamic subreports problem

edited August 2003 in Subreports
I am using dynamically loading subreports to chain together a few separate
reports. The individual reports are quite substantial in their own right and
can be printed separately. It works fine except when there is a subreport
inside one of the reports being loaded. I tried it with the RB demo as well
(see RBuilder\Demos\3.End User\5. Dynamic subreport Loading) and I get an AV
there as well. I just put an empty subreport in the "myTitleTemplate" and
the problem appears (the mySettings.ini has to be set to get the reports
from the DB)
Any ideas?
Thanks
Yannis

Comments

  • edited August 2003
    What version of RB are you using? There was a change to the demo for RB 7.
    If you are using an older version of RB, then try modifying the code in the
    demo to look like this in the LoadSubreport procedure:

    procedure TmyDynamicLoadingSubReport.LoadSubreport;
    begin

    if (Band is TppTitleBand) then
    LoadTitleSubreport

    else if (Band is TppHeaderBand) then
    LoadHeaderSubreport

    else if (Band is TppFooterBand) then
    LoadFooterSubreport;

    Report.Engine.State := Report.Engine.State - [esInitialized];

    Init;

    end; { procedure, LoadSubreport }



    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited August 2003
    Ok,
    I have downloaded the latest version 7.03 and I noticed in the eample 2
    differences.
    1. There is nothing but the loading of subreports in the LoadSubreport
    procedure, and
    2. In the StartOfMainReport the call to "inherited StartOfMainReport;" is
    AFTER the LoadSubReport (in previous version it was BEFORE).
    Following the current example everything works fine
    Thanks
    Yannis

  • edited August 2003
    Yes, some timing changed in RB for our Server Edition 7.0 and this resulted
    in a couple changes to the Dynamic Subreport Loading demo.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.