Trapping errors
I trying to trap a simple EPrintError error but for some reason it's evading
my except clause. I've got a TPPReport which fails on Print and returns an
EPrintError. MadExcept picks it up and gets the exception message Unable to
open file: .
How come this doesn't pick it up?
begin
strTextFileName := 'somefilename'
frmrapp314.ppReport.AllowPrintToFile := True;
frmrapp314.ppReport.ShowPrintDialog := False;
frmrapp314.ppReport.DeviceType := 'PDF';
frmrapp314.ppReport.TextFileName := strTextFileName;
frmrapp314.ppReport.Print; <- this fails
blnOK := true; <- and then after I've clicked Continue in MadExcept
the debugger continues from here.
end
except
raise Exception.Create(<some message in Norwegian>');
end;
How do I get this picked up?
TIA,
Håvard
my except clause. I've got a TPPReport which fails on Print and returns an
EPrintError. MadExcept picks it up and gets the exception message Unable to
open file: .
How come this doesn't pick it up?
begin
strTextFileName := 'somefilename'
frmrapp314.ppReport.AllowPrintToFile := True;
frmrapp314.ppReport.ShowPrintDialog := False;
frmrapp314.ppReport.DeviceType := 'PDF';
frmrapp314.ppReport.TextFileName := strTextFileName;
frmrapp314.ppReport.Print; <- this fails
blnOK := true; <- and then after I've clicked Continue in MadExcept
the debugger continues from here.
end
except
raise Exception.Create(<some message in Norwegian>');
end;
How do I get this picked up?
TIA,
Håvard
This discussion has been closed.
Comments
This is an issue with the modal cancel dialog preventing the exceptions from
being raised. Try setting the ShowCancelDialog property of the report to
False and see if that solves the problem.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Worked like a treat!
Thanks,
Håvard