ppReport.LoadFromFile procedure causes application to hang
I am trying to use the ppReport.Template.LoadFromFile to load a number of
reports into the database. The code below is run for a list of files if
they exist. The problem comes in when an invalid format is encountered.
The program will freeze when executing Template.LoadFromFile on the next
file (even if it is a proper format).
The code:
for x := x to <# of file names in list> do
try
with MainForm.ppReport1 do
begin
{First, Load the template}
Template.SaveTo := stFile;
Template.FileName := ;
Template.LoadFromFile;
{Then, Save it to the Database}
Template.SaveTo := stDatabase;
Template.DatabaseSettings.Name := ;
Template.SaveToDataBase;
end;
except
end;
Any help on this issue would be greatly appreciated.
Regards,
Eric Hansen
eric.hansen@protelinc.com
reports into the database. The code below is run for a list of files if
they exist. The problem comes in when an invalid format is encountered.
The program will freeze when executing Template.LoadFromFile on the next
file (even if it is a proper format).
The code:
for x := x to <# of file names in list> do
try
with MainForm.ppReport1 do
begin
{First, Load the template}
Template.SaveTo := stFile;
Template.FileName := ;
Template.LoadFromFile;
{Then, Save it to the Database}
Template.SaveTo := stDatabase;
Template.DatabaseSettings.Name := ;
Template.SaveToDataBase;
end;
except
end;
Any help on this issue would be greatly appreciated.
Regards,
Eric Hansen
eric.hansen@protelinc.com
This discussion has been closed.
Comments
fails to load. Then you don't want to save the template to the database if
it raises an ETemplateLoadError exception.
BTW- You do not have to set the SaveTo property because this is assumed when
you call the LoadFromFile and SaveToDatabase methods on the template.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com