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

SERIOUS BUG in ppEngine.pas

edited August 2002 in General
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

Comments

  • edited August 2002
    Thanks for reporting this problem and great work fixing it!

    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
  • edited August 2002
    Hi,

    Could you repeat the original message. It seems to have gotten lost

    Joseph Gordon

  • edited August 2002
    Yes, the newsgroup server was 'regenerated' this weekend. You'll need to
    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
This discussion has been closed.