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

Template Error Crashes Application

edited April 2003 in General
Hello,

Delphi 5
ReportBuilder 6.03 Enterprise Edition

After I try to load an invalid report template (LoadFromFile generates an
"Invalid Template Error"), my application crashes upon close and cannot be
exited without using the Task Manager. No errors are displayed; the
application simply hangs indefinitely.

To duplicate this problem, put a report component on the form, and set the
filename to file with an .rtm extension that you know to be invalid. Under
a button, place the following code:

rpt.Template.LoadFromfile;
rpt.print;

The "Invalid Template Error" appears when I try and load it. When I close
the application, it hangs indefinitely. Note that I can "suppress" the
error with a Try/Except statement, but still the application will not close.
Any combination of statements (such as "rpt.Template.New") in the "Except"
portion have not helped, and in fact it appears that only the statement
immediately following the "Except" statement is executed.

Of course, the obvious solution would be to prevent the user from loading
invalid templates, but this is difficult because of the portability of the
files (i.e. corruption through e-mail transfer). The template may also be
invalid because either it is lacking offset information or has included a
differently-sized offset. Incidentally, how would one handle loading a
template that didn't have have offset information at all (whereas on
LoadStream i'm checking the for the cHeaderID constant as set out in the
Tech Tips example)? This also generates the scenario outlined above.

Thanks,

Leah

Comments

  • edited April 2003
    Hi Leah,

    when I create a application like you mentioned then I get the 'Invalid Template Error' as expected but I have no problems in closing the application. Did you start the application from inside Delphi's IDE? If that is the case start it as stand alone.

    regards,
    Chris Ueberall;
  • edited April 2003
    I started it within Delphi's IDE and then outside. Same problem with
    closing both times. Ran the exe on both Windows 2000 and XP. Same problem.

    When I compiled it in Delphi 6, I did not have this problem, but this is
    not an option at this time.

    Leah


  • edited April 2003
    Leah,

    as I already said, I can't reproduce the problem. I tested with (D5, RBE 5.6) and (D7, RBE 7.02).
    Can you create a simple application that reproduces the problem and send it to support?

    regards,
    Chris Ueberall;
  • edited April 2003
    Leah, I searched the logs and there was an issue like this that has been
    fixed in RB 7. Try testing with RB 7.02 to see if the problem goes away.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.