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

Changing dbtext -> datafield dynamically (by code)

edited May 2008 in General
Hi All,

How can dbtext's datafield be changed by code (dynamically), is it possible?

Delphi 7, RB 10.08 STD.

Thanks in advance.

Best regards,
H?seyin

Comments

  • edited May 2008
    H?seyin,


    Assuming that you know the object name, you can use the following code to
    change the field associated with the DBText object at runtime.

    procedure SetDBField(Report : TppReport; ObjName, DataField: String);
    var
    Obj : TppPrintable;
    begin
    Obj := TppPrintable(Report.FindUserObject(ObjName));
    if Obj <> nil then Obj.DataField := DataField;
    end;

    Hope this helps.

    --

    ---------------------------------------
    Terry Swiers
    Millennium Software, LLC
    http://www.1000years.com
    http://www.atrex.com

    Atrex Inventory Control/POS -
    Big business features without spending big business bucks!

    Atrex Electronic Support Options:
    Atrex Knowledgebase: http://www.atrex.com/atrexkb.asp
    Email: mailto:support@atrex.com
  • edited May 2008
    Hi Terry,

    Thanks for the reply, i'll try and see how far i can go :)

    Best regards,
    H?seyin


    "Terry Swiers" skrev i en meddelelse
This discussion has been closed.