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

Solution to 'A component named xxx already exists'

edited September 2012 in General
Hi,

I had a strange occurrence today that was driving me nuts. When adding a
tPPLine to my component I go the error message that a component named
xxx already exists.

When I found the component, and renamed it to something else, it would
allow me to add that component (using that name), but the second time I
attempted to add another of the same component, the error returned.

In the end I believe I found the problem.

I had the following components on my form:

ppLine1 : TppLine
ppLine2 : TppLine
....

ppLine13 : TppLine
ppLine14 : TppImage
....

Because some components were named 'pplinexx' but were in fact a
TppImage component - it was causing all sorts of problems with Delphi
trying to name the next available component.

Delphi 2007. Not sure if it was a Delphi issue, or a ReportBuilder
issue, but I put it up here incase anyone else has a similar issue in
the future and can't find out why.

Comments

  • edited September 2012
    Adam H. wrote:


    Any chance you manually changed ppLine14 from a TppLine to a TppImage,
    such as opening the DFM and changing the declaration for ppLine14?

    I'm not sure how the IDE determines the 'next' name to use when
    automatically naming components. But I can certainly see how it could
    try to use ppLine14 as the name of a new TppLine component. :(
  • edited September 2012
    On 20/09/2012 5:43 PM, Jon Robertson wrote:

    Yes - I may have changed the component type at some stage - but even so,
    interesting that it caused issues.
This discussion has been closed.