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

AV when Freeing ppReporter form

edited May 2003 in General
We are having an issue freeing the ppReport form after printing to the
screen. We have tried using .Cancel before freeing the form as per a
pervious post and this is making no difference. I understand this could be a
timing issue - the code seems to AV within the TppRelative class - when
performing actions with FChildren.

We are using PrintToDevices and printing to a TppViewer component on the
form.

It there anyway around this?

Any help would be really helpful.

Comments

  • edited May 2003
    When are you calling .Free?

    Ed Dressel
    Team DM
  • edited May 2003
    We call .Release on the form - expecting it to kill the ppReport - it runs
    the full OnDestroy event handler for the form and AV's liek I've said within
    the TppRelv. class

  • edited May 2003
    Okay, where are you calling .Release from? What event?
    --
    Ed Dressel
    Team DM
  • edited May 2003
    I'm having the same problem too.
    I just sent a sample application to support.

    Thanks,
    Paul


  • edited May 2003
    First, make sure that the report is not freed while it is still executing.
    Make sure that the Report.Print call has exited and then you should be able
    to safely free the report.

    try
    Report.Print;
    finally
    CloseTheForm;
    end;


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited May 2003
    Thanks Jim,

    But that will only work if the preview is modal. In an MDI application what
    happens if the user wants to run two reports at the same time?
    I sent a sample application to support to show what I'm trying to do.

    Thanks again!
    Paul Klomp



This discussion has been closed.