Keep getting AV error when closing application
Hi all,
I'm currently using one TppReport on my mainform, and previewing
a form via a template:
ppReport.Template.FileName := 'E:\Developing\Projects\Database
Workbench\Output\Report\ib_domains.rtm';
ppReport.Template.Load;
ppReport.Print;
The pipeline used comes from a datamodule in another package which
is dynamically loaded and unloaded on the application close.
The above code is in an auto-loaded package and is called from the
main form of the application.
Upon main-form/application closure, I keep getting an AV error on
4003BA4F (rtl70.bpl) which is part of the TComponent.Notification
method.
Does someone have ANY idea what I'm doing wrong?
--
With regards,
Martijn Tonies
Database Workbench - the developer tool for InterBase & Firebird
Upscene Productions
http://www.upscene.com
I'm currently using one TppReport on my mainform, and previewing
a form via a template:
ppReport.Template.FileName := 'E:\Developing\Projects\Database
Workbench\Output\Report\ib_domains.rtm';
ppReport.Template.Load;
ppReport.Print;
The pipeline used comes from a datamodule in another package which
is dynamically loaded and unloaded on the application close.
The above code is in an auto-loaded package and is called from the
main form of the application.
Upon main-form/application closure, I keep getting an AV error on
4003BA4F (rtl70.bpl) which is part of the TComponent.Notification
method.
Does someone have ANY idea what I'm doing wrong?
--
With regards,
Martijn Tonies
Database Workbench - the developer tool for InterBase & Firebird
Upscene Productions
http://www.upscene.com
This discussion has been closed.
Comments
Are you using a TeeChart in your report? Please send a small example
demonstrating the issue in .zip format to support@digital-metaphors.com
along with the version of Delphi, RB, and OS you are using.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
No, I'm not.
I'm not sure if I can 'easily' reproduce the issue.
I'm using D7 pro, RB7 Ent trial and W2k.
The app only shows the error if I did a preview - with the code
I've shown in the 1st post.
Would additional TppReport components bother? (there's one
in the datamodule in order to create the reports, the one on the
main form is used for viewing).
--
With regards,
Martijn Tonies
Good news -
I've solved it!
I've changed my "preview" code to:
ppReport.Template.FileName := 'E:\Developing\Projects\Database
Workbench\Output\Report\ib_domains.rtm';
ppReport.Template.Load;
ppReport.Print;
ppReport.Template.New;
By doing the Template.New, it seems to clear all Delphi objects which
are available in the report (ugh). The dynamically created datamodule
was being destroyed in the package finalization - which worked fine,
until, of course, the main form ppReport component started messing
around with it. Or something like that.
Does this make sense to you?
--
With regards,
Martijn Tonies
Database Workbench - the developer tool for InterBase & Firebird
Upscene Productions
http://www.upscene.com
Glad you got it working. The TppReportTemplate.New method clears and frees
all current report components and creates a new one. There was probably
something in your report that was not getting freed properly. If you are
still curious about what the problem was, please send an example to
support@digital-metaphors.com and I'll take a look for you.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
No, I'm not curious - I just didn't expect such a close run-time attachment
to Delphi... :-) ... It seems RB is really really Delphi minded.
FWIW, it could be mentioned in the Help that if you use templates/loading
reports that use stuff from packages etc, it could help to do a .New before
destroying things.
--
With regards,
Martijn Tonies
Database Workbench - the developer tool for InterBase & Firebird
Upscene Productions
http://www.upscene.com