Page 1 of 1

Blank lines on labels

PostPosted: Mon Jan 17, 2011 10:11 pm
by Fitch
My label has an Address1 and Address2 line. If Address2 is blank I'd like the text below to slide up the way merge fields normally do.

Can the MergeExpressions custom function be modified to deal with this? Or do you have any other suggestions?

Re: Blank lines on labels

PostPosted: Tue Jan 18, 2011 9:58 am
by John Sindelar
You don't want to edit MergeExpressions to do this directly as it is used everywhere, not only where there are return separated values. Rather, remember that you can include calculations in your merge fields so instead of...

<<CONTACTS::Full Name>>
<<CONTACTS::Street 1>>
<<CONTACTS::Street 2>>
<<CONTACTS::City 1>>, <<CONTACTS::State Province 1>> <<CONTACTS::Postal Code 1>>

...try...

<<CONTACTS::Full Name>>
<<CONTACTS::Street 1 & if ( not isempty (CONTACTS::Street 2) ; ΒΆ & CONTACTS::Street 2 )>>
<<CONTACTS::City 1>>, <<CONTACTS::State Province 1>> <<CONTACTS::Postal Code 1>>

Re: Blank lines on labels

PostPosted: Wed Jan 19, 2011 10:58 pm
by Fitch
I knew there was some way to do it - thanks! At first I didn't get it, but then I looked closer at your example and realized the key is that the calc has to be in brackets, like the fields. I found that both of these methods gave me the result I wanted:

<<CONTACTS::Full Name>>
<<List(Location::Address1;Location::Address2)>>
<<Location::City>>, <<Location::State>> <<Location::PostalCode>>

<<List (
CONTACTS::Full Name ;
Location::Address1 ;
Location::Address2 ;
Location::City & ", " & Location::State & " " & Location::PostalCode )>>