Canceling report from Custom preview during formatting
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
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
This discussion has been closed.
Comments
close message:
Postmessage(Handle, WM_CLOSE, 0, 0);
--
Ed Dressel
Team DM