Problems with Template.LoadFromFile
Hi
I have a TppReport on a form and have to load different RTM file's into it
more than twice into the TppReport. On some occasions, it will not load
these files into the template. I cannot work out why this is happening. Is
there anything you know of that would stop a template being loaded ?
--------
procedure TReportTreeFrm.OpenTemplate;
begin
OpenDialog.InitialDir := ExtractFilePath (Application.ExeName);
if OpenDialog.Execute then
begin
ppReport.Template.FileName := OpenDialog.FileName;
ppReport.Template.LoadFromFile;
if ppLabelNodeInfo.Caption <> '' then ProcessTemplate (True);
end; { if OpenDialog ... }
end;
--------
Thanks
Tony
I have a TppReport on a form and have to load different RTM file's into it
more than twice into the TppReport. On some occasions, it will not load
these files into the template. I cannot work out why this is happening. Is
there anything you know of that would stop a template being loaded ?
--------
procedure TReportTreeFrm.OpenTemplate;
begin
OpenDialog.InitialDir := ExtractFilePath (Application.ExeName);
if OpenDialog.Execute then
begin
ppReport.Template.FileName := OpenDialog.FileName;
ppReport.Template.LoadFromFile;
if ppLabelNodeInfo.Caption <> '' then ProcessTemplate (True);
end; { if OpenDialog ... }
end;
--------
Thanks
Tony
This discussion has been closed.
Comments
This is not a known issue with ReportBuilder. As a test, try tracing into
this code to be sure the correct file name is being assigned to the
Template.FileName. Also be sure the Template.FileName is not being reset in
some of your other code... ProcessTemplate perhaps. If you are still having
an issue, please send a simple example demonstrating the problem to
support@digital-metaphors.com and I'll take a look at it for you.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I have spent 3 hours trying to debug this and I have tried all of your
suggestion prior to you suggesting them and am still at a loss. The
Template.FileName is getting changed correctly and ProcessTemplate does not
reset it in any way.
It is going to take serveral hours to cut this application down to something
small enough for you to view. I will endevour to do this for you tommorow.
Tony