Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Concatenated fields not showing Post Reply Post New Topic
Author Message
Talat
Newbie
Newbie
Avatar

Joined: 24 Jun 2014
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote Talat Replybullet Topic: Concatenated fields not showing
     Posted: 24 Jun 2014 at 6:03am
Hi,

I am writing a labels report to print address labels from an Access database. I have concatenated Town and Zip fields in to a new formula field "TownZip" and also the title and full_name field into "FormalName"

I am finding that where one of the concatenated fields is empty, the new formula field is suppressed. Changing   "supress if blank" option has no effect. If, for example I add "Mr" to title field on a database record, then all is well. But whenever any of the concatenated fields are empty, then nothing is printed for that line. I am using Version 11, yet I had successfully done this before with v8.5.

Anyone can help how to solve this?

Many thanks,

Talat
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 24 Jun 2014 at 6:29am
in your concatenate formula
change exceptions for nulls to default values for nulls
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 24 Jun 2014 at 9:15am
I'm not sure that the feature that kostya mentions is available in Crystal 8.5. If it's not, you'll have to do something like the following:

StringVar title := "";
StringVar full_name := "";
if not IsNull({MyTable.Title}) then title := {MyTable.Title} + " ";
if not IsNull({MyTable.Full_Name}) then full_name := {MyTable.Full_Name};
title + full_name

You would do the same type of thing for your Town/Zip combination.

For more information about working with null values in Crystal, see my blog post here: http://sapbiblog.com/2013/03/25/what-is-null-and-why-is-it-important-for-crystal-reports/.

-Dell
IP IP Logged
Talat
Newbie
Newbie
Avatar

Joined: 24 Jun 2014
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote Talat Replybullet Posted: 24 Jun 2014 at 11:34pm
Thank you Hilfy and Kostya.

Changing each of the formula fields (one shown below) to:

StringVar title_name := "";
StringVar full_name := "";
if not IsNull({Recipient.title_name}) then title_name:= {Recipient.title_name} + " ";
if not IsNull({Recipient.Full_Name}) then full_name := {Recipient.Full_Name};
Trim ({Recipient.title_name} & ' ' & {Recipient.full_name})

as well as changing the null handling report option has sorted me out.

I am grateful to both of you.

Talât
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