cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

String Concatenation - Line Breaks

Former Member
0 Likes
3,779

Hello all,

It has been quite some time since I've worked within Crystal reports! Following is my latest question:

When concatenating strings, is there anyway to make a line break? I am trying to make an address block, but I cannot figure out how to get the City/State on its own line without pulling the address line / city-state fields in separately.

Here is a snippet:

{mail.addr_1}' '{mail.addr_2} + ' '+ {@CityState}

I would like to see each field on its own line, but I do not want to place each field on its own because addr_2 is not guaranteed to have any value.

Note: @CityState is just a formula that combines City, State and Zip...

Thanks,

Holly C Schulz

View Entire Topic
vitaly_izmaylov
Product and Topic Expert
Product and Topic Expert
0 Likes

I have tested the following formula:

{mail.addr_1} + (if not IsNull ({mail.addr_2}) then chr(13) + {mail.addr_2};) + {@CityState}

It works when there is no data for {mail.addr_2}

Former Member
0 Likes

I know it's been a long time since this thread was active but this worked exactly as I needed.  My problem is I need it to continue for 6 lines.  When I created this it failed.  With the addition of the Line 3  I am having blanks for addresses without a Line 2.

{@FamRegAddressLine1}+(if not IsNull ({@FamRegAddressLine2}) then chr(13) + {@FamRegAddressLine2};) + (if not IsNull ({@FamRegAddressLine3}) then chr(13) + {@FamRegAddressLine3};) + {@FamRegAddressLine4}

Can anyone help me with this?

Thank you so much,

Michele Booher