Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text appearance

Status
Not open for further replies.

dorub

Programmer
Oct 15, 2002
12
0
0
RO
Hi,
I have a text in my report based on diffrent database fileds representing personal information (name,street, city .. etc).
But because the data retrived differ in size , the text is not fluent but full with a lot of spaces.Is there any possibility to anchor the fields together in the report (like in Oracle Reports)?
 
Examples of the data and expected output would go a long way in getting you a prompt answer. Also, what crystal version are you using along with the type of database and connectivity.

But is I understand what you are saying, you could adapt my address formula I use in Crystal 8.5 with an Oracle database.

Code:
StringVar addr := "";

If IsNull({ADDRESSES.STREET_NUMBER}) Then
    addr := addr
Else
    addr := addr + ToText({ADDRESSES.STREET_NUMBER});

If IsNull({ADDRESSES.DIRCT_CD_DIRECTION_CODE}) Then
    addr := addr
Else
    addr := TrimLeft(addr +" "+{ADDRESSES.DIRCT_CD_DIRECTION_CODE});

If IsNull({ADDRESSES.STREET_NAME}) Then
    addr := addr
Else
    addr := TrimLeft(addr + " " + {ADDRESSES.STREET_NAME});

If IsNull({ADDRESSES.DIRECT_SUFFIX}) Then
    addr := addr 
Else
    addr := TrimLeft(addr +" "+{ADDRESSES.DIRECT_SUFFIX});

if isnull({ADDRESSES.SUB_NUMBER}) then
    addr := addr
else addr := addr + " #" + {ADDRESSES.SUB_NUMBER};

If IsNull({ADDRESSES.CITY}) And IsNull({ADDRESSES.STATE_CD_STATE_CODE}) Then
    addr := addr
Else If IsNull({ADDRESSES.CITY}) And Not(IsNull({ADDRESSES.STATE_CD_STATE_CODE})) Then
    addr := addr + ", "+ {ADDRESSES.STATE_CD_STATE_CODE}
Else If {ADDRESSES.CITY} = "WICHITA" And Not(IsNull({ADDRESSES.STATE_CD_STATE_CODE})) Then
    addr := addr
Else If Not(IsNull({ADDRESSES.CITY})) and IsNull({ADDRESSES.STATE_CD_STATE_CODE}) Then
    addr := addr + "  " + {ADDRESSES.CITY}
Else
    addr := addr + "  " + {ADDRESSES.CITY} + ", " + {ADDRESSES.STATE_CD_STATE_CODE}; 

If trim(addr) = "" Then
    "No address listed..."
Else
    trim(ADDR)


-LW
 
thanks kskid, this should work for me too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top