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

ppReport2 error. How to delete ppReport2

edited August 2001 in General
Hi,

I'm using one form with one report component to read 3 report
templates. After some fiddling with the report templates to get the
reports as I want them, I am now getting an error:

"ppReport2.OnPreviewFormCreate: Invalid property value."

In my report template, I can't find a 'Report2', so I can't delete
this beast. Any ideas? Do I need to erase everything and start over?

Where did ppReport2 come from?

Thanks,
Phil

Comments

  • edited August 2001
    See the Templates thread in the TechTips newsgroup for an explanation on
    using templates and Delphi event handlers.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited August 2001
    Jim,

    I read through the 'Templates' thread, and, unfortunately, none of the
    topics touched on my problem.

    My problem is that a second report 'ppReport2' has somehow come into
    being in the template (ppReport1 is the report I am working with).
    ppReport2 does not appear on the object inspector, nor anywhere else
    that I can find when I load the template in the report designer.
    Yet, I get the error message noted below when loading the template at
    run time.

    How do I get rid of this phantom 'ppReport2'?

    Thanks,
    Phil


    On Wed, 15 Aug 2001 08:49:02 -0500, "Jim Bennett \(Digital
  • edited August 2001
    It seems like the ppReport2 is coming from the fact that there is already a
    ppReport1 component on the form. When you load a template, RB instantiates
    a temporary report object which loads the template and then copies the
    report to the one on the form that you've created, and then it frees the
    temporary template. Since there is a naming conflict between the ppReport1
    on the form and the ppReport1 in the template, the newly instantiated one
    gets changed to ppReport2. However, there is no way for the event handler
    from the ppReport1 template to hook up to the proper event handler on the
    form since the name conflicts (the ppReport1 template is now loaded into the
    ppReport2 report object on the form). I would suggest renaming all of your
    report templates to something more meaningful, and try to load them at
    runtime.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited August 2001
    Jim,

    Thanks for the suggestion. I rebuilt the report from scratch, and it
    works just fine now. There was definitely something out of synch in
    the original template.

    I'll try renaming the report component in the future, to test the
    results.

    Regards,
    Phil



    On Wed, 15 Aug 2001 13:52:46 -0500, "Jim Bennett \(Digital
This discussion has been closed.