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

OnGetText Event

edited July 2002 in General
Hi,

I have a report that I am creating entirely in code. It consists of a main
report with mulitple number of childreports placed in the detail band. In
one of my DBText components, I need to change the value of the DBText.Text
after it gets it's value from the DBText.DataField. How do I call on the
DBText.OnGetText Event in code. So far I haven't had any luck. Any help
would be appreicated.

Thank You,

--
Jada C. Case
Programmer
jada@signaldata.com

Comments

  • edited July 2002
    1. Create a procedure with the same parameters that the expected for the event

    procedure MyGetTextProc(Sender: TObject; var Text: String);
    begin
    ....
    Text := YourValue;
    end;

    2. Assign that procedure to your component's OnGetText event when create it:

    MyLabel.OnGetText := MyGetTextProc;

  • edited July 2002
    Hi Jada,

    you don't have to call an event, you have to assign an event handler for it.

    myDBText.OnGetText := myDBTextOnGetText;

    define the event handler as follows

    procedure myDBTextOnGetText(var Text : String);


    HTH,
    Chris Ueberall;

  • edited July 2002
    Jada,

    please see Guillermo's answer, he used the right syntax for Delphi, mine was
    for RAP.

    regards,
    Chris Ueberall;

  • edited July 2002
    Thank You for such quick replies.


This discussion has been closed.