Acces violation when canceling a report pre-view
Hello,
How can I cancel the visualization of a report in a ppViewer and let a
ppreport completely clear?
I Tried to cancel a visualization and when I free the form, an access
violation occurs. It only occurs
sometimes. The error is "Access Violation in module 'ntdll.dll' ".
It seems to be the template of the ppReport that it can't free.
I have tried the next methods in different combinations: Report.Cancel,
Report.Reset, Template.New,
Template.Free, Viewer.Reset, Viewer.Cancel.
The objective is: Stop a long preview and free the form if the user wish
exit from the form.
Thanks for all
How can I cancel the visualization of a report in a ppViewer and let a
ppreport completely clear?
I Tried to cancel a visualization and when I free the form, an access
violation occurs. It only occurs
sometimes. The error is "Access Violation in module 'ntdll.dll' ".
It seems to be the template of the ppReport that it can't free.
I have tried the next methods in different combinations: Report.Cancel,
Report.Reset, Template.New,
Template.Free, Viewer.Reset, Viewer.Cancel.
The objective is: Stop a long preview and free the form if the user wish
exit from the form.
Thanks for all
This discussion has been closed.
Comments
Report.PrintToDevices..
procedure TForm1.btnPrintClick(Sender: TObject);
begin
ppReport1.PrintToDevices;
if ppReport1.Engine.StopPrinting then
begin
ppReport1.Free;
Close;
end;
end;
procedure TForm1.btnCancelClick(Sender: TObject);
begin
ppViewer1.Cancel;
end;
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com