Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Making Value of field blank based on info Post Reply Post New Topic
Author Message
lorimack
Groupie
Groupie


Joined: 03 Nov 2009
Online Status: Offline
Posts: 48
Quote lorimack Replybullet Topic: Making Value of field blank based on info
     Posted: 03 Nov 2009 at 9:07am
Hi there,
 
I have a simple question but cannot figure it out!  I am somewhat new to crystal and I am proud of what I have taught myself so far, however, I am stuck on this one!
 
How can I have the value of a field not appear based on the value of another field?
 
For instance if field A = "yes"  then field B should display "today"
but if field A = "No" then field B should be blank.
 
Any help would be appreciated.
 
 
Thanks,
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Nov 2009 at 9:16am

You cannot alter existing data in Crystal but you can create a new formula field to display instead of an existing field.

Right click on the Formula FIeld and select New
name the fomula (I'll call it "IsToday")
if {table.fieldA}="yes" then "Today" else "No"
Place this on your reprot canvas instead of 'field B' from your data source.
 
IP IP Logged
lorimack
Groupie
Groupie


Joined: 03 Nov 2009
Online Status: Offline
Posts: 48
Quote lorimack Replybullet Posted: 03 Nov 2009 at 9:22am

Thank you very much for your response.

 
I will try that,
 
this is what I have so far, but it always asks me for a date.  Is there a way to override that?
 
if {@Status} = "Active"  then {cpmain.dispdate} ???????
 
I want the date to be blank, I even tried to set it so that that field would be white in text so it wouldn't show, but it still asks me to put a date there.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Nov 2009 at 9:32am

You cannot make NULL values and dates cannot be an empty string.

The answer depends on what you are really trying to do. If this is simply to decide if you want to display the {cpmain.dispdate} field then you can use conditional suppression of that field rather than trying to alter it.
If so:
right click on the {cpmain.dispdate} field
select format field
click on the COmmon Tab
Click on the X-2 (formula) next to the Suppress
enter you formula
{@ Status} = "Active" 
Save and close it
However, I am guessing you are trying to do something else here and I am only seeing a small part. If that is the case, what is the whole process?


Edited by DBlank - 03 Nov 2009 at 9:35am
IP IP Logged
lorimack
Groupie
Groupie


Joined: 03 Nov 2009
Online Status: Offline
Posts: 48
Quote lorimack Replybullet Posted: 03 Nov 2009 at 10:36am
Tongue
It was that simple and I could never figure it out!!!!!
 
I didn't even think about trying to supress the field itself!
 
Thank you so much for your help!
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