Cancelling a report from a Delphi Form
D7, RB7, Interbase
I have a report that I have coded a pass through function for that calls a
Delphi form I have designed.
On the form I have the option to cancel the report in which case the result
of the function is False.
How do I get an RB report file to just close without doing anything else if
the result of my function is false.
eg If not myFunction
then Report.Terminate
TIA
Rhonda Ridge
I have a report that I have coded a pass through function for that calls a
Delphi form I have designed.
On the form I have the option to cancel the report in which case the result
of the function is False.
How do I get an RB report file to just close without doing anything else if
the result of my function is false.
eg If not myFunction
then Report.Terminate
TIA
Rhonda Ridge
This discussion has been closed.
Comments
you can try closing the preview form. I tried it, but I needed to use a
timer to wait until after the form shown and was able to be closed.
procedure TForm1.Button1Click(Sender: TObject);
begin
ppReport1.print;
end;
procedure TForm1.ppReport1EndFirstPass(Sender: TObject);
begin
Timer1.Enabled := True;
end;
{this is the timer's OnTimer event handler. I set the interval to 100.}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
ppReport1.Cancel;
if ppReport1.PreviewForm <> nil then
ppReport1.PreviewForm.Close;
end;
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com