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

Address formating formula 3

Status
Not open for further replies.

hf28

Programmer
Oct 23, 2003
54
US
Hello everyone,

I'm not a Crystal person. I'm curious. If for an example a have 4 lines for the address on my report, but some addresses have the same length, but some only 2 lines, then how should I formate my address to not show 2 empty lines for those "short" addresses.

Thanks a lot in advance.
 
Create a text object, and drag all four fields that make up the address:

{Table.Address1}
{Table.Address2}
{Table.Address3}
{Table.Address4}

Then, right click on the text object>Format Text> and check "Suppress Embedded Field Blank Lines". That will take care of the empty fields.

Of course, this may be version dependant, but you didn't specify.

-dave
 
There are 2 standard solutions to this problem:

1. Put each address line into its own subsection and format the subsection to 'suppress if blank'. That works fine for most cases.

2. Create a 'block address' formula such as:

@BlockAddress
(if isnull({add1}) then "" else {add1} + chr(13)) +
(if isnull({add2}) then "" else {add2} + chr(13)) +
(if isnull({add3}) then "" else {add3} + chr(13)) +
(if isnull({add4}) then "" else {add4})

This second method results in a field that contains only the non-null address lines separated by return characters.

Steve Phillips, Crystal Consultant
 
There is another option.

Add a text object to the report for your address.
Drag each address field from the Field Explorer to the text object. Each address field should actually become part of the Text Object.
Hit the Enter key in between each field that needs to be on its own line.
You may need to stretch the bottom border down so that all lines are displayed.
Now, Right Click the text object and choose Format Text.
Under the Common tab, select the option "Suppress Embedded Field Blank Lines".

~Brian
 
Easy when you know how!! Thanks a lot for this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top