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

Access violation when deleting tppLine

edited August 2002 in General
Hi there,

Delphi 5 (Enterprise) is consistently giving me an Access Violation in
Vcl50.bpl when deleting a TppLine component. From my experience, this
happens after I've added more than, say 5, TppLine components. I can
continue to add shapes without a problem, but as soon as I delete one, I get
the AV. The component dissapears from the band, but I can't save or edit
after that happens. Have to exit Delphi and try again.

Using ReportBuilder Standard 5.55.

Thanks for any advice!

Nat Williams

Comments

  • edited August 2002
    Are you placing your Reports on a TDatamodule? Move the reports to a TForm
    and your problem will go away.


    Cheers,

    Jim Bennett
    Digital Metaphors


    -------------------------------------------
    Article: TppReport and TDataModule
    -------------------------------------------

    "I've been told not to place a TppReport on TDataModules, but I prefer
    to keep my non-visual components on data modules. TppReport is
    non-visual, why can't I do that?"


    There are two good reasons to avoid placing your TppReport component on a
    TDataModule:

    1. While TppReport is ostensibly a non-visual component, the components
    which make up the report (TppLabel, TppLine, TppMemo, etc.) are obviously
    visual. Although the report designer is provided to allow for visual
    creation of reports, it cannot be the owner of these visual components.
    Therefore, when controls are created during the layout process, they
    are given another owner - the form which owns the TppReport (Obviously
    the TppReport cannot own them either). The end result of this is that
    when laying out a report that is owned by a TDataModule, you are
    effectively adding visual components to an object that was never
    intended to own visual components. This can result in very unpredictable
    results.

    2. The TDataModule designer in Delphi 5 was redesigned to include a
    treeview which enumerates the various components owned by the data
    module and their properties. As a result, when a component that is owned
    by the module is modified, the designer recurses all the components
    and populates the tree with their property values. When a TppReport is
    placed on a TDataModule, many components and properties are added to that
    tree. The process of constantly updating these values can tend to cause
    a very large performance lag in larger, more complex reports.


    --
    Tech Support mailto:support@digital-metaphors.com
    Digital Metaphors http://www.digital-metaphors.com



This discussion has been closed.