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

Canceling report from Custom preview during formatting

edited April 2003 in General
Greetings,


I have a custom preview form that includes a cancel button. It is enabled
while the report is being generated. When pressed, I want to stop generating
the report and close the form.

It is also enabled after the report is generated. In this case, I just need
it to close the form. I use the following code to do this:

I use the following code to do this:

if not ppViewer1.Busy then

begin

Close;

Exit;

end;

ppViewer1.Cancel;

Close;

When the report is still being generated, the button stops the report from
being generated, but does close the preview form. After the report is
generated, the button will close the form. The effect, is that when the
report is being generated, the user must press the button twice: first to
stop generation, then a second time to close the form.

How can I close the form immediately after canceling the
report?

Thanks,

Andy

Comments

  • edited April 2003
    Without seeing your code, I can't say for sure, but try posting a windows
    close message:

    Postmessage(Handle, WM_CLOSE, 0, 0);

    --
    Ed Dressel
    Team DM
This discussion has been closed.