SERIOUS BUG in ppEngine.pas
Hi there,
I've just found a serious bug in ppEngine.pas. The global engine object is
not properly reset when loading a new report.
You need to add the following lines to TppEngine.Reset:
AfterSendPage := nil;
BeforeSendPage := nil;
Without these lines the following happens:
If you load a print preview of a report containing a subreport which is
configured as a section, it sets Engine.AfterSendPage to
TppSubreport.SectionAfterSendPageEvent in TppSubreport.GenerateSection.
Inside SectionAfterSendPageEvent the subreport refers to a global band
object.
If you then close the report and open another one containing no subreport,
Engine.AfterSendPage is still set to TppSubReport.SectionAfterSendPageEvent.
But the global band object then does not need to have a defined state
because SectionAfterSendPageEvent would not have to be called, which almost
always results in a reference to a nil-pointer.
It could be that there is still more to cleanup in TppEngine.Reset. You (DM)
should take a closer look at this.
regards,
Andreas Kr?gersen
I've just found a serious bug in ppEngine.pas. The global engine object is
not properly reset when loading a new report.
You need to add the following lines to TppEngine.Reset:
AfterSendPage := nil;
BeforeSendPage := nil;
Without these lines the following happens:
If you load a print preview of a report containing a subreport which is
configured as a section, it sets Engine.AfterSendPage to
TppSubreport.SectionAfterSendPageEvent in TppSubreport.GenerateSection.
Inside SectionAfterSendPageEvent the subreport refers to a global band
object.
If you then close the report and open another one containing no subreport,
Engine.AfterSendPage is still set to TppSubReport.SectionAfterSendPageEvent.
But the global band object then does not need to have a defined state
because SectionAfterSendPageEvent would not have to be called, which almost
always results in a reference to a nil-pointer.
It could be that there is still more to cleanup in TppEngine.Reset. You (DM)
should take a closer look at this.
regards,
Andreas Kr?gersen
This discussion has been closed.
Comments
This problem was first reported in May, 2002 and was fixed at that time - a
patch is available.
Of course, the fix will also appear in version 7.0, which is only a few
weeks away at this point...
--
Cheers,
Tom Ollar
Digital Metaphors Corporation
http://www.digital-metaphors.com
info@digital-metaphors.com
Could you repeat the original message. It seems to have gotten lost
Joseph Gordon
refresh all of your cached messages for the threads to build properly...
--
Cheers,
Tom Ollar
Digital Metaphors Corporation
Original Message follows...
Hi there,
I've just found a serious bug in ppEngine.pas. The global engine object is
not properly reset when loading a new report.
You need to add the following lines to TppEngine.Reset:
AfterSendPage := nil;
BeforeSendPage := nil;
Without these lines the following happens:
If you load a print preview of a report containing a subreport which is
configured as a section, it sets Engine.AfterSendPage to
TppSubreport.SectionAfterSendPageEvent in TppSubreport.GenerateSection.
Inside SectionAfterSendPageEvent the subreport refers to a global band
object.
If you then close the report and open another one containing no subreport,
Engine.AfterSendPage is still set to TppSubReport.SectionAfterSendPageEvent.
But the global band object then does not need to have a defined state
because SectionAfterSendPageEvent would not have to be called, which almost
always results in a reference to a nil-pointer.
It could be that there is still more to cleanup in TppEngine.Reset. You (DM)
should take a closer look at this.
regards,
Andreas Kr?gersen
http://www.digital-metaphors.com
info@digital-metaphors.com