TppReport bombs on FormCreate
I have a TppReport on a Tform along with the Datapipline, Datasource and
TADOStoredProc. They are used at design time to design reports and then at
runtime to launch them. I am just setting the Template name at runtime as
well as priming the dataset.
It works fine other than when I deployed it the user got a "file not found"
error when creating the form. I thought that was because the template
filename property was still assigned to the property of the component at
design time and it did not exist at that location on the user's machine.
I removed the template name, and re-compiled. The app now gives me the
"file not found" error. Nothing short of removing the TppReport component
and resorting to creating, using and destroying a private TppReport object
on the form would make it work correctly.
Why does the TppReport component physically check for the template assigned
to that property when it is being created? Makes no sense.
Thanks
TADOStoredProc. They are used at design time to design reports and then at
runtime to launch them. I am just setting the Template name at runtime as
well as priming the dataset.
It works fine other than when I deployed it the user got a "file not found"
error when creating the form. I thought that was because the template
filename property was still assigned to the property of the component at
design time and it did not exist at that location on the user's machine.
I removed the template name, and re-compiled. The app now gives me the
"file not found" error. Nothing short of removing the TppReport component
and resorting to creating, using and destroying a private TppReport object
on the form would make it work correctly.
Why does the TppReport component physically check for the template assigned
to that property when it is being created? Makes no sense.
Thanks
This discussion has been closed.
Comments
Be sure you have the Report.SaveAsTemplate property set to False. If this
property is enabled, the report will try to load the template file when it
is created.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
delete it from the property in the IDE, it is holding on to it.
Sorry for the delay in this response. My newsreader somehow lost track of
this thread.
The only reason ReportBuilder will try check for a template file is if the
Report.SaveAsTemplate property is set to True. If you change your library
path to point to the RBuilder\Source directory and set your debugger to
break on exceptions, you will see that the exception is occuring in the
TppTemplate.LoadFromSource method inside the ppTmplat.pas file. Other than
this, there is no other code in ReportBuilder that checks for the presence
of the template file.
As a test, you can try placing a TppReport and a button on a new form. Then
set the Report.Template.FileName to something you know doesn't exist and be
sure the Report.SaveAsTemplate property is set to False. You should then
have no problems running the app and viewing the report. If you re-run the
app with SaveAsTemplate set to True, you will see the exception.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I will give that a try. I just also d/ld and installed v7.04.
Reid
I changed your source so that RB doesn't try to load a empty filename. Maybe
you should do the same.
Gruß aus den Bergen
Günter
Thanks for the suggestion.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com