Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Field Formatting with Display String Post Reply Post New Topic
Author Message
avaj
Newbie
Newbie


Joined: 26 Sep 2007
Online Status: Offline
Posts: 30
Quote avaj Replybullet Topic: Field Formatting with Display String
     Posted: 27 Jun 2008 at 6:02am
Hi all, I am using Crystal XI.  I am trying to use the Display String formula under Field Format to set a field to "NONE" if no records are selected.  Anyone done this before?
 
I tried doing an IF statement using the record selection formula and ELSE set to "NONE".  I just get blanks.  Also tried defining a variable as "NONE" but that didn't help.
 
I tried using the RecordNumber function checking for #0, 1 etc. still doesn't give me what I want.  
 
Any ideas how to put something on the report if no records are selected? 
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 27 Jun 2008 at 12:47pm
You can use this function to test if there are no records in a report:
IsNull(Count({table.yourfield}));

Create a text box that says "No Records" and suppress it when this formula is false (or do something similar that you like).

My Encyclopedia book is filled with tips and tricks for creating reports. You can find out more about my books at Amazon.com or reading the Crystal Reports eBooks online.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
avaj
Newbie
Newbie


Joined: 26 Sep 2007
Online Status: Offline
Posts: 30
Quote avaj Replybullet Posted: 03 Jul 2008 at 5:32am
This worked perfectly.  Thanks!!
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