Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Display blank and non-blank fields Post Reply Post New Topic
Author Message
JFinzel
Groupie
Groupie
Avatar

Joined: 20 Jul 2011
Location: United States
Online Status: Offline
Posts: 49
Quote JFinzel Replybullet Topic: Display blank and non-blank fields
     Posted: 20 Jul 2011 at 11:00am
I have been searching for this because I thought for sure people would have asked this, and maybe it is obvious but I can't figure it out.

I have a report that is simply a giving report by person.  I want to display spouse names for people who have spouses, but I still want to display the people who do not have spouses.  When I add the field for spouse name, it takes out all records that do not have spouses.

I tried formula:
IF {CnSpSpBio.CnSpSpBio_Name} = "" THEN "" ELSE {CnSpSpBio.CnSpSpBio_Name}

This doesn't do anything but the same as if I put in the field - it eliminates any records where the field is blank.

PS - I know this is possible with a subreport, but it seems like there must be an easier way.  Subreport limits how I want to display the spouse name.

Any help is much appreciated!


Edited by JFinzel - 20 Jul 2011 at 11:01am
IP IP Logged
CircleD
Senior Member
Senior Member
Avatar

Joined: 11 Mar 2011
Location: United States
Online Status: Offline
Posts: 251
Quote CircleD Replybullet Posted: 20 Jul 2011 at 1:37pm
How are you adding it?All you should have to do is add the spouse field in a separate column and it should print the spouse where appropriate and leave a blank space where not.
IP IP Logged
JFinzel
Groupie
Groupie
Avatar

Joined: 20 Jul 2011
Location: United States
Online Status: Offline
Posts: 49
Quote JFinzel Replybullet Posted: 21 Jul 2011 at 4:00am
I simply drag the field for spouse name into the report designer, into Group #2 header (right next to Group #2 Name, which is the Head of Household name).  It automatically takes out anyone who has no spouse when I do this.  PS this is Crystal Reports XI.
IP IP Logged
chris
Newbie
Newbie


Joined: 02 Apr 2008
Location: United Kingdom
Online Status: Offline
Posts: 35
Quote chris Replybullet Posted: 21 Jul 2011 at 4:54am

Is the spouse name held in a separate table which you have linked to?

If it is, it sounds like you have an Inner join to that table instead of a Left Outer Join.
 
Chris
IP IP Logged
JFinzel
Groupie
Groupie
Avatar

Joined: 20 Jul 2011
Location: United States
Online Status: Offline
Posts: 49
Quote JFinzel Replybullet Posted: 21 Jul 2011 at 5:14am
The spouse name is definitely in a separate table.  I am a newbie, as my title so adequately states, so can you explain to me what you mean by inner join vs. outer join?
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 21 Jul 2011 at 5:30am
there are different kind of joins
inner join where the values must be equal in both tables
outer joins where the it will retrieve records from both tables not just what is equal.
if you go to the database expert, tables and right click on your join
make it a left outer join
then re-run the report.
sharona
IP IP Logged
JFinzel
Groupie
Groupie
Avatar

Joined: 20 Jul 2011
Location: United States
Online Status: Offline
Posts: 49
Quote JFinzel Replybullet Posted: 21 Jul 2011 at 6:03am
Thank you!  This worked!
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