I have a table which contains customers' records. My goal is to print out the customer's address in a nice format. The customer's record contains address line 1, address line 2, address line 3, address line 4, city, state, zipcode, country. If any of the fields is blank or null, I don't want to print it out so the result may look like this (Each customer will be printed in a separate page along with other information):

Customer Name Customer Name
Address line 1 Address line 3
Address line 2 Address line 4
Address line 3 City, State Zipcode
City, State Zipcode Country
Country

I have the following formula using the IIF function. For some reasons, the report prints the address for some records but not others. Do you why??? Thanks...

WhilePrintingRecords;
{customer.cus_name}+chr(13)+
IIF (IsNull ({customer.cus_addr1}) or {customer.cus_addr1}= "" or Length ({customer.cus_addr1})=0, "", {customer.cus_addr1}+chr(13)) &
IIF (IsNull ({customer.cus_addr2}) or {customer.cus_addr2}= "" or Length ({customer.cus_addr2})=0, "", {customer.cus_addr2}+chr(13)) &
IIF (IsNull ({customer.cus_addr3}) or {customer.cus_addr3}= "" or Length ({customer.cus_addr3})=0, "", {customer.cus_addr3}+chr(13)) &
IIF (IsNull ({customer.cus_city}) or {customer.cus_city}= "" or Length ({customer.cus_city})=0, "", {customer.cus_city}+", ") &
IIF (IsNull ({customer.cus_state}) or {customer.cus_state}= "" or Length ({customer.cus_state})=0,"",{customer.cus_state}+" ") &
IIF (IsNull ({customer.cus_zip}) or {customer.cus_zip}="" or Length ({customer.cus_zip})=0,""+chr(13), {customer.cus_zip}+chr(13)) &
{customer.cus_country}