Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: If statement in a text object Post Reply Post New Topic
Author Message
Central
Groupie
Groupie


Joined: 16 Feb 2011
Online Status: Offline
Posts: 56
Quote Central Replybullet Topic: If statement in a text object
     Posted: 06 Feb 2013 at 6:04am
Can you have an IF statement in a text box.
 
e.g.
 
Formulas @ABC, @CDE, @FGH
 
If database field = "y" then
@ABC
@CDE
@FGH
else
"There are no data to report etc.."
 
or can this be done in a formula and if so what would the syntax be?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Feb 2013 at 9:04am
you can conditionally suppress fields placed in the text box or you can create a new formula field to do what you desire
 
If {table.field}= "y" then
{@ABC} + chr(13)
{@CDE} + chr(13)
else
"There are no data to report etc.."
IP IP Logged
Central
Groupie
Groupie


Joined: 16 Feb 2011
Online Status: Offline
Posts: 56
Quote Central Replybullet Posted: 07 Feb 2013 at 12:04am
Done as you replied and works a treat.
 
Thanks again 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