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

DrillDownComponent in loaded template

edited December 2008 in Subreports
I have a problem with drilling down subreports in a loaded template.
There is a report I designed in the Delphi IDE. It contains subreports
with an image for drilling down. If I print it on screen, it works good,
but if I load the same layout from a rtm-file, it doesn't work.

Does anybody have an idea how I can solve this problem?

Cheers
Ingo



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited December 2008
    Hi Ingo,

    --------------------------------------------
    Article: Troubleshooting Lost Event Handlers
    --------------------------------------------

    Let's assume you have created a report in Delphi and assign an event
    handlers to the OnPreviewFormCreate event of the report. The event is
    generated by Delphi as:

    procedure TForm1.ppReport1PreviewFormCreate(Sender: TObject);

    You then save the report to an RTM file 'Report1.RTM.' The events are
    stored as references only, and so the RTM contains:

    object ppReport1: TppReport
    .
    .
    OnPreviewFormCreate = ppReport1PreviewFormCreate
    end

    You then go on to work on a different report. Saving it with under then
    name 'Report2.RTM'. Only this time, before you save the report you
    change the report component name to: rptOrders. Delphi automatically
    updates the event declaration for OnPreviewFormCreate event to:

    procedure TForm1.rptOrdersPreviewFormCreate(Sender: TObject);


    You then create two buttons on the form, one to load Report1 and preview,
    the other to load Report2 and preview. When you run the app and click
    Report1, you an error. This is because the Report1.RTM file contains a
    reference to ppReport1PreviewFormCreate, a method which no longer exists (at
    least with this name) in the form.

    One answer is to load all your rtm files into the report component you will
    be using for loading. Fix any errors, reassign any events that get cleared.
    This will update your rtms to contain the proper event handler names.


    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2008
    Hi Nico,

    thank you for your hints, but the event handler isn't the problem. I
    have created a report with two subreports. The subreports could be
    drilled down by an image, if you print it on the screen. My problem is,
    that report builder makes differences between integrated templates and
    templates you load with REPORT.TEMPLATE.LOADFROMFILE().

    The subreport properties look like this:

    object ppSubReport2: TppSubReport
    UserName = 'SubReport2'
    DrillDownComponent = ppImage2
    ExpandAll = False
    NewPrintJob = False
    OutlineSettings.CreateNode = True
    TraverseAllData = False

    ppImage2 is used to expand the subreport. It works fine with the
    integrated report.

    Cheers
    Ingo


    preview,
    exists (at
    will
    cleared.
  • edited December 2008
    Hi Ingo,

    This is not a known issue. Which version of ReportBuilder and Delphi are
    you using? Are you able to recreate this with a simple example? If so,
    please send the example in .zip format to support@digital-metaphors.com and
    I'll take a look at it for you.
    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.