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

How to remove/delete component in RAP

edited March 2008 in RAP
Hi,


how can I delete an Object in RAP?

In FirstPas I create an memo-field:

tMemo := TppMemo.Create(Report);
tMemo.Band := Detail;
tMemo.Stretch := True;
tMemo.left := 0;
tMemo.Top := tTop;
tMemo.Lines.Text := IntToStr(tIdx);
tMemo.UserName := 'mem'+IntToStr(tIdx);
tMemo.Name := 'mem'+IntToStr(tIdx);


in secondpass i get the message
"a component named mem1 already exists".

how can i work with "mem1" or delete it in RAP-code?

i tryed

Report.ObjectByName(tIdx, tIdy, 'mem1')

but it didn?t work

bye

Jan

--
EasternGraphics - visualize your business

Jan Hoffmann, Entwicklung
http://www.EasternGraphics.com
phone: +49 3677 67820

EasternGraphics GmbH - Albert-Einstein-Strasse 1 - DE-98693 Ilmenau
Geschaeftsfuehrer - Ekkehard Beier, Volker Blankenberg, Frank Wicht
Amtsgericht Jena - HRB 304052

Comments

  • edited March 2008

    I recommend adding code to check for FirstPass.

    if Report.FirstPass then
    begin
    {create memo object}
    end;

    You cannot create/destroy objects during the second pass. You need to define
    the report layout prior to the report engine calculating the page space
    required for each object - pagination calcs are performed during the first
    pass.



    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.