The Issue:
A number of clients have been contacting me recently, regarding having spacing in their reports which contain address fields, where there are missing data.
In Crystal Reports, this can be easily solved as one can use the features of the sections to work around this problem, an alternative method is to create a formula.
The Solution:
Create a formula that checks to see f the address fields are empty, before adding them into the formula:
{AddressTable.Company} &
IF {AddressTable.Address 1} <> "" THEN CHR(13) & CHR(10) & {AddressTable.Address 1} &"," ELSE ""
IF {AddressTable.Address 2} <> "" THEN CHR(13) & CHR(10) & {AddressTable.Address 2} &", " ELSE ""
IF {AddressTable.Town} <>"" THEN CHR(13) & CHR(10) & {AddressTable.Town} &", " ELSE ""
IF {AddressTable.City} <> "" THEN CHR(13) & CHR(10) & {AddressTable.City} &", " "" ELSE ""
IF {AddressTable.County} <> "" THEN CHR(13) & CHR(10) & {AddressTable.County} &", "
ELSE CHR(13) & CHR(10) & {AddressTable.Post Code} &"."
Add the field to the required section.
If you have any questions, leave us a comment below, or need any assistance, please do not hesitate to Contact Us
|