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

ReposrtDesigner Access violation on closing

edited July 2015 in General
Hi,

I am using ReportBuilder 15 and often (but not always) get an access
violation when closing the report designer at runtime.

I have a TppDesigner component on a datamodule form that is opened as
follows:

ProcessOptions; //Create datasources with some data so preview works
//Set up stanard setting for the report
Utils.ConfigureReport(TheReport,ReportName,'A report title');
DataModule1.ReportDesigner.Report := TheReport;
try
DataModule1.ReportDesigner.ShowModal;
finally
Close; //This is when error occurs
end;

The call stack on the access vioslation (going backwards is)

TList.Get
TppCustomReport.GetTheBand
TppCustomRTeport.SetReportDesigner
TppDesignerWindow.SetReport
TppDesignerWindow.Notification
TComponent.RemoveFreeNotifications
TComponent.Destroy
TppCommunicateor.Destroy
TppRelative.Destroy
TppProducer.Destroy
TppCustomReport.Destroy
TppReport.Destroy
TObject.Free

Any ideas on what I am doing wrong?

Thanks

Comments

  • edited July 2015
    Hi Steve,

    Looking at your call stack and code, it appears you have your report on
    your form but the designer on a data module? It is generally best to
    keep the two components in the same "container" however not completely
    necessary.

    My best guess is that this is a destroy timing issue in some instances.
    I would suggest setting the Designer.Report property to nil before
    closing the form to be sure the destroy sequence executes cleanly.

    try
    DataModule1.ReportDesigner.ShowModal;
    finally
    DataModule1.ReportDesigner.Report := nil;
    Close; //This is when error occurs
    end;

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2015
    In article <55ad2bb3$1@mail.>, support@digital-metaphors.com says...


    Nico,

    Thanks for the reply - seems to have done the trick!

    However, I am now consistently getting a memory leak reported every time
    I use the report designer at runtime when quitting the application:-

    1-12 bytes TppMRUTemplateItemCollection x 1
    TMoveArrayManager x 3
    x 3
    unknown x 2
    13 - 20 bytes TList x 1
    Unicodestring x 1
    21 - 28 bytes TObjectList x 1
    Unicodestring x 5
    unknown x 1
    29 - 36 bytes TList x 3
    TFontsettings x 17
    Unicodestring x 3
    + more (including TppTBMRUListString, TppMRUList, TppTBCustomItem,
    TppTBXSeperatorItem, TppTBXItem, TBXMRUListItem, TppDesignFileMenu

    Do I need to explicitly free anyobjects after calling the
    reportDeisgner?

    Thanks

    Steve
  • edited July 2015
    Hi Steve,

    Are you able to recreate this with a simple example I could run here
    using only Delphi and RB components? If so, please send it in .zip
    format to support@digital-metaphors.com and I'll test with the latest
    version of ReportBuilder.

    Best Regards,

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