Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

TppReport bombs on FormCreate

edited July 2004 in General
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

Comments

  • edited July 2004
    Hi Reid,

    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.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2004
    As I stated, noting short of deleting it will let the project load. I did
    delete it from the property in the IDE, it is holding on to it.
  • edited July 2004
    Hi Reid,

    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.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2004
    THanks,

    I will give that a try. I just also d/ld and installed v7.04.

    Reid
  • edited August 2004
    In article <41055a37$2@dm500.>, Nico Cizik (Digital Metaphors) wrote:

    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
  • edited August 2004
    Hi Gunter,

    Thanks for the suggestion.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.