Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Combining Address fields Post Reply Post New Topic
Author Message
gaby
Newbie
Newbie


Joined: 23 Aug 2012
Location: United Kingdom
Online Status: Offline
Posts: 11
Quote gaby Replybullet Topic: Combining Address fields
     Posted: 23 Aug 2012 at 12:26am
Hi All,

I'm very new to crystal, but getting there!! We have crystal 11 and I am writing a report where I want to show certain attributes affiliated to addresses.

The address table we have breakdowns the the address into multiple fields, i.e street number, street name, town etc if I input each section into the report and then export this into excel the merged cells I end up with are a nightmare. Is there a formula I can right that will combine all the address fields into one (I've tried formula fields, but frankly don't know where to start!)

hope that makes sense!

Thanks
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 23 Aug 2012 at 3:43am
Absolutely there is a way to do this!  If there is the potential for any of the fields to be null, you'll need to account for that.  I would create one formula for each "part" of the address that looks something like this:
 
If IsNull({street number}) then "" else {street number} + " "
 
To put the comma between city and state I would do this:
 
If IsNull({city}) then "" else {city} + ", "
 
You can then concatenate these two different ways:
 
1.  Drag a text block onto your report where you want the address to appear.  Then drag each of the formula into this text block.  This will concatenate the formulas.
2.  Create another formula that will concatenate the other formulas:
{@Street#} + {@StreetName} + ...etc.
 
-Dell
IP IP Logged
gaby
Newbie
Newbie


Joined: 23 Aug 2012
Location: United Kingdom
Online Status: Offline
Posts: 11
Quote gaby Replybullet Posted: 23 Aug 2012 at 4:45am
That's perfect thank you!!!!!
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum