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

Detail Band Event Not Firing

edited October 2002 in General
I've encountered this problem a couple of times now. I've developed a
report outside of the main application. Works great. Now I copy the
components and event code into the main application. I have two
events: a report detail before print and a report image before print.

In the development program, the report detail event fires, then the
image event fires. In the the main application, the report detail
event does not fire. I've checked to see that the event is set in the
detail band component... ie, I double click the BeforePrint event and
it takes me to the code that is supposed to execute but does not.
Ideas?

Comments

  • edited October 2002
    > In the development program, the report detail event fires, then the

    Where does the event show in the interface? If it is not before the private,
    ie

    TForm1 = class(TForm)
    //event should be here

    private
    public
    end;

    then it won't stream, and therefore won't fire. You should copy the code for
    the event and re-generate the event by double clicking on the detail band
    and pasting the event code.

    Also note that dbl clicking takes you to the code, but doesn't mean the code
    was hooked. Use the Object Inspector's Event's tab for this.
    Ed Dressel
  • edited October 2002
    Ed Dressel - Team DM wrote:


    Ed... thanks for the pointers. I neglected to mention that the report in
    question was loaded from a template. Oddly enough, the report worked fine in
    its small development application, but failed in the main application. However,
    in the development app, I did as you suggested. I deleted the BeforePrint
    events for the band, then reset them up completely, then saved the report
    template. It did the trick.

    But now I have a question. The report template is a component stream, yah?
    But, the actual event code is owned by the form on which the report resides.
    So, how is the event code address resolved when a template is loaded into
    memory?
  • edited October 2002
    You event handler is not getting reassinged when the template loads. Please
    see the templates thread of our tech-tips newsgroup for an article which
    desctibes why it happens and how you can resolve it.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.