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

truncate a text in dbtext

edited October 2004 in General
I' sorry, but not have I understand well the procedure that me explain.
You could detail me more as being able to truncate the text of a dbtext and
can me
posteriorment to assign it to a label or a variable.
That type of code I must use to truncate part of the text of the dbtext and
that code I
must use to assign to the label or to variable it again.

graces.

Comments

  • edited October 2004
    Hi Dani,

    You will need to retrieve the field value inside the DetailBand.BeforePrint
    event, then using any number of Delphi string handling routines, truncate
    the field value as you need. Then assign the result to the Text property of
    a TppLabel inside the detail band. Something like the following...

    lsFieldValue := Report.DataPipeline['MyField'];

    liTruncPos := Pos(':', lsFieldValue);

    liSubStrCount := Length(lsFieldValue) - liTruncPos;

    lsFieldValue := Copy(lsFieldValue, liTruncPos, liSubStrCount);

    Label.Text := lsFieldValue;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.