how to stop preview a report in a loop
Hi,
I use a loop to preview a list of report like this:
for i:= 1 to 100 do
begin
ProcessMessages;
Report1.Device = 'Screen';
Report1.ModalPreview := true;
Report1.Print;
end;
But I want to the user can stop to preview during the loop. If I set Device
to Printer, I have chance to use a button to break the loop. But I can not
find a chance to stop the loop if I set the device to screen because when I
click the close button in the Preview screen and RB start to preview the
next report again. so how can break the loop?
Thanks
Tao
I use a loop to preview a list of report like this:
for i:= 1 to 100 do
begin
ProcessMessages;
Report1.Device = 'Screen';
Report1.ModalPreview := true;
Report1.Print;
end;
But I want to the user can stop to preview during the loop. If I set Device
to Printer, I have chance to use a button to break the loop. But I can not
find a chance to stop the loop if I set the device to screen because when I
click the close button in the Preview screen and RB start to preview the
next report again. so how can break the loop?
Thanks
Tao
This discussion has been closed.
Comments
I would use e.g. the ESC key as interruptor. Since you have already a
'ProcessMessages', it will be no problem to read the keyboard.
regards,
Chris Ueberall;