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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return Character in Formula 1

Status
Not open for further replies.

Hillary

Programmer
Feb 15, 2002
377
US
I am concatinating some fields and would like one line to display under the other. Does anyone know how to insert a return character into a formula? I am using Crystal Syntex.

Ex. "{Customer.Address1} "&"{Customer.City}, "&"{Customer.State} "&"{Customer.ZipCode}"

Instead of...
123 Main Street Rochester, NY 14624

I want...
123 Main Street
Rochester, NY 14624

Thanks for your help!

Hillary
 
Try chr(13):

{Customer.Address1} +chr(13)
+{Customer.City}+", "+{Customer.State}+" "+{Customer.ZipCode}"

-k
 
Thanks that worked great (although you do need the + after the Chr(13) : )). I'm sure you can help me with this, if not I'll start a new thread...

{CUSTOMER.NAME}+Chr(13)+
{CUSTOMER.ADDR_1}+Chr(13)+
If {CUSTOMER.ADDR_2} <> &quot;&quot; then {CUSTOMER.ADDR_2} else
If {CUSTOMER.ADDR_3} <> &quot;&quot; then {CUSTOMER.ADDR_3} else
{CUSTOMER.CITY}+&quot;, &quot;+{CUSTOMER.STATE}+&quot; &quot;+{CUSTOMER.ZIPCODE}+Chr(13)+{CUSTOMER.COUNTRY}

When there is a value in {CUSTOMER.ADDR_2}, the value shows then the formula stops. What I want is when there is a value in {CUSTOMER.ADDR_2} then show the value and continue the formula; evaluate for {CUSTOMER.ADDR_3} and ALWAYS return City, State, Zip and Country.

Thanks!

Hillary
 
Hilary,

Are you just trying to supress blanks lines? If so, then this works great:

1. Place a text box in the section where the mailing info is to go
2. place all the fields inside the text box, as such:

******************************************************************
*{CUSTOMER.NAME *
*{CUSTOMER.ADDR_1} *
*{CUSTOMER.ADDR_2} *
*{CUSTOMER.ADDR_3} *
*{CUSTOMER.CITY}, {CUSTOMER.STATE} {CUSTOMER.ZIPCODE} *
*{CUSTOMER.COUNTRY} *
******************************************************************


3. Then right click on the text box and check &quot;Supress Embedded Field Blank Lines&quot; . . .

There is no need for char(13) or '+' or '&' in there.

Hope this helps.

-Robert
aka: DallasAggie
 
Yes, I'm trying to suppress {Customer.Addr_2} & {Customer.Addr_3} where they are null. Your example is how I ran the test but this address formula is embeded in a letter (mail merge).

Thanks for the suggestion!

Hillary
 
There is a plus after the chr(13), it's on the next line.

A simpler means to accomplish all of this is to create a separate section for each detail line, and then select suppress blank section.

Then you don't need the formula at all, just place each line in it's own section.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top