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

Sporadic template loading trouble.

edited August 2005 in RAP
I've got a sporadic problem that I can't seem to nail down. I occasionally
get an error similar to:
"Unable to load BeforePrint code for GroupHeaderBand3, no object with this
name found"
when loading a report template from a database (Firebird 1.5 and Interbase
6.5.)

We're currently using v6.03 enterprise.

I can't currently provide an application that reproduces the problem
consistently, but was hoping that someone may be able to offer some insight
on the problem.

Thanks.

Comments

  • edited August 2005
    Hi Brent,

    When a template is saved to file or database, all event references to the
    report and its components are saved down as well. This error indicates that
    there is a reference in the template to the GroupHeaderBand3.BeforePrint
    event but this event does not exist in your current application. If your
    event code is kept in RAP, you need to be sure these templates actually
    contain the RAP code corresponding to these events.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2005
    Thanks Niko,
    I have a library of reports that are available to the end user. When the
    end user previews or prints a report, most of the time the report will load
    successfully and be printed/previewed. However, very occasionally, perhaps
    once in 100 attempts, the loading will fail with the error indicated in the
    above post. The error could occur in any of the reports and any of the
    reports events. As you may have guessed, the loading continues without
    loading the event code that was indicated in the message, most often
    breaking the report.

    Once the error occurs, it can be reproduced with the same results, but
    once the application is restarted, the error is no longer reproducable. When
    I review the report in the designer, the object that could not be found
    during the loading process (GroupHeaderBand3, for example) does, in fact,
    exist, but no event code has been loaded for it.

    As far as the way I store the reports, they can be stored either on the
    file system or in the DB. I've seen the problem when the data is stored as
    both binary and ASCII.

    Just to clarify-- Does the error indicate that the event code cannot be
    found, or that the object associated with the event cannot be found?

    Thanks,
    Brent
  • edited August 2005
    Some additional information/clarification:
    Although the object referenced in the error message exists, the name of
    the object has changed. For instance, the object named GroupHeaderBand3 is
    now named something like GroupHeaderBand40. Also, I've really only seen the
    problem associated with group header and footer bands. It also occurs if
    I"ve renamed the band, as well.

    Thanks,
    Brent

  • edited August 2005
    Hi Brent,

    Is your event code inside RAP? If you take a look at the ASCII text of the
    saved templates, you will see that the reference to the event code is kept
    based on the name of the event. If you re-name the band before loading the
    template, it will most likely be unable to find the proper event code.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2005
    Hi Nico,
    Yes, the event code is inside RAP. The band isn't renamed before loading
    the template, in fact, if I close the application and reload the template,
    it works again.
    The root of the problem appears to be that the "LoadSetName" function
    within the class TppReportTemplate inappropriately changes the name of the
    component as it's created during the streaming process. Unfortunately, I
    can't seem to figure out why it does this some times and not others, so
    obviously I can't provide an application that reproduces the problem.
    I've managed to capture the ASCII text of the stream after it's been
    loaded from the blob field, and there are no differences between it and the
    text before it's read (so I don't think it's a problem loading the dtram
    from the blob field.)

    Thanks,
    Brent

  • edited August 2005
    Hi Brent,

    Sorry, after seeing that the problem was in the LoadSetName function and
    reading your previous posts I realized you are using RB 6.03. This logic
    has been enhanced since RB 6.03. My recomendation would be to download a
    trial version of RB 9.02 and see if that helps the issue.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2005
    Thanks Nico, I'll give that a try.

    Brent

This discussion has been closed.