Crystal Reports for Eclipse Designer Guide

TrimLeft (str)

TrimLeft and LTrim (str) are equivalent functions.
Description
TrimLeft removes all spaces to the left of a string or data field which is stored as a right-justified string in a database.
Arguments
  • str is a text string.
  • Returns
    String value
    Action
    TrimLeft removes all spaces to the left of a string or data field which is stored as a right-justified string in a database.
    Typical uses
  • Use this function any time there are leading blanks in a text object that may interfere with an alignment of text strings, a character count, or with a calculation (if the string is eventually converted to a Number).
  • Use whenever you combine (concatenate) justified text strings and want to have the proper spacing between strings.
  • Examples
    TrimLeft("    A1/4520/B12")
    Returns "A1/4520/B12".
    TrimLeft("    200")
    Returns "200", where the text string "200" is right-justified with leading blanks.
    You have two right-justified database fields, {file.FOOD1} and {file.FOOD2}. Each field can hold up to 15 characters. {file.FOOD1} contains the word bread and {file.FOOD2} contains the word butter. If you were to print these words, they would appear like this:
    "          bread"
    "         butter"
    For each 15-character field the database includes the field value, right-justified plus enough blank spaces to fill up the field. To use these words without the leading spaces (to create the expression bread and butter, for example) use the TrimLeft function in the following manner:
    TrimLeft({file.FOOD1}) + " and " + TrimLeft({file.FOOD2})
    Returns "bread and butter".
    The spaces enclosed in the quotation marks before and after the word and assure that there is the correct spacing between the three words in the resulting sentence.



    SAP BusinessObjects
    http://www.sap.com/sapbusinessobjects/
    Support services
    http://service.sap.com/bosap-support/
    Product Documentation on the Web
    http://help.sap.com/