Detail Band Event Not Firing
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?
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?
This discussion has been closed.
Comments
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
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?
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
http://www.digital-metaphors.com
info@digital-metaphors.com