Crystal Reports & SQL Reporting Services Training Consultants
Account Log in:
Username:
Password:
Don't judge what you don't understand
 
Institute of IT Trainers - Freelance Trainer of the Year 2006 & 2009
Liverpool Business Connect Member
  Maximum Impact Solutions Limited - Reporting Solutions, Creating Answers
Reporting Solutions - Creating Answers, Crystal Reports, Dashboarding (Xcelsius) & SQL Reporting Services

The Maximum Impact Solutions Blog Feed ME!!!!

09
June

How Do I Prevent Having Spacing in my Addresses in my Crystal Reports

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

MAKE A COMMENT

Name *

Email Address *

Comment *