cancel
Showing results for 
Search instead for 
Did you mean: 

Need to include address lines only if there is a value.

Former Member
0 Kudos

My data base has four possible fields for the physical street address. Field 1 is always populated and the other 3 are only populated if needed. I am creating an invoice with the Name and address at the top of the form. Is there a way to include the address lines only if they are populated and ignore if it is blank?

Thanks,

Rick

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

One way I would tackle this is to define a Formula Field and build up the address in there. Use chr(13) to add line feeds where required.

An alternative is to use formula fields for each field with a condition like this:


if isnull({LGNOM_partyAddress.addressLine1} ) or (length ({LGNOM_partyAddress.addressLine1}) = 0)
then ""
else chr(13) + {LGNOM_partyAddress.addressLine1}

and then add a text field to the report and just pull each expression field into the text field. Have them follow immediately after each other. The chr(13) will force a line feed prior to each value it displays. Set the 'Can Grow' property (or just make the field the size you want).

Michael.

Former Member
0 Kudos

Thanks,

Both solutions worked.

Rick

Former Member
0 Kudos

Hi Rick,

I created my templates with a (page/group header) section for each address row - ex. PHa, PHb, PHc, etc. If the fields are blank, then the section is suppressed and I don't have a blank line.

Heather

Answers (1)

Answers (1)

Former Member
0 Kudos

The easiest way is to place all 4 fields in a text box.

Right click and format text box, at bottom check suppress embedded field blank lines.

Ian