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

Removing Extra CRs from a TppDBMemo Before Printing

edited October 2003 in General
My users have a bad habit of pressing carriage return in memo fields instead
of letting them word wrap.

Is there a way to remove all of the carriage returns from a TppDBMemo before
printing? What I would like is to simply word wrap on new lines with a
couple of inserted spaces.

Alternately, how can I make the TppDBMemo component autosize to hold the
multiple lines of text? I tried .Stretch=TRUE, but that when the memo has 3
lines it overwrites the next line, a TppLabel.

Thanks,

-Johnnie

Comments

  • edited October 2003
    Hi Johnnie,

    A TppDBMemo component is separated into separate strings (based on a carrage
    return or the point a word wrap occured) and placed into a TStringList
    before being written to a report. It would be possible to perhaps to take
    the TppDBMemo.Lines object, put all the strings in the list into one
    temporary single string, then separate them out again according to the size
    of the memo control into another TStringList.

    For your alternative, you should simply be able to set the
    TppLabel.ShiftWithParent property to true and the label will move with the
    band. If this does not give you the results you desire, try placing the
    label inside a TppRegion with the region set to ShiftRelativeTo your DBMemo.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2003
    "Nico Cizik (Digital Metaphors)" wrote in
This discussion has been closed.