Check for wrong template-files
I want to check wether a report-template has the correct format.
Therefore I load the template into a report-component with following
code:
try
Report.Template.FileName:='C:\Temp\Reports\ppTmDlg.rtm';
Report.Template.LoadFromFile;
except
on E: EInvalidTemplateError do
showmessage(E.Message);
end;
When I load any text-file, the Exception raises, but then my app freezes
and I have to kill the process. Am I missing something or exists another
way.
I use Win2000, Delphi5, RB6.03
Guido
Therefore I load the template into a report-component with following
code:
try
Report.Template.FileName:='C:\Temp\Reports\ppTmDlg.rtm';
Report.Template.LoadFromFile;
except
on E: EInvalidTemplateError do
showmessage(E.Message);
end;
When I load any text-file, the Exception raises, but then my app freezes
and I have to kill the process. Am I missing something or exists another
way.
I use Win2000, Delphi5, RB6.03
Guido
This discussion has been closed.
Comments
default. Here is a simple form app event handler which works for the
exception, and the main app continues running after the exception.
uses
ppTypes;
procedure TForm1.Button1Click(Sender: TObject);
begin
ppReport1.Template.Filename := 'C:\123.rtm';
try
ppReport1.Template.LoadFromFile;
except
on e: EInvalidTemplateError do
Application.HandleException(Self);
end;
end;
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
You are right, the app continues running, but I can't close the app. I still
have to kill the process.
Guido
exception. What does you code do before and after the exception? Are you
freeing any objects that you need to in a try/finally around the call to
print this report? Please provide a simple test application that shows this
problem and send it to support@digital-metaphors.com
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com