Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: If then else Post Reply Post New Topic
Author Message
sri-knight22
Newbie
Newbie
Avatar

Joined: 06 Jan 2012
Online Status: Offline
Posts: 16
Quote sri-knight22 Replybullet Topic: If then else
     Posted: 12 Jun 2012 at 10:02am
I am trying to modify an invoice report.  I am adding a section to show the total number of labor hours worked.  There are 3 fields that will be shown. 

1) Labor Hours - This either needs to show the {Total Number of Hours} OR the words "Flat Rate"

2) This either needs to read "Labor Rate: {XXX}" OR Labor Price:{XXX}" or Labor Rate = "No Charge"

3) Total - This either needs to be {TLR} or "No Charge"


I know all of the fields I need, but I just cant sort out the logic. 
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 12 Jun 2012 at 10:32am
How is it determined that (for example) it is the {Total Number of Hours} or "Flat Rate"?

You can have a formula like this:  if <some logic to determine which to show> then totext({Total Number of Hours}) else "Flat Rate"

Of course #2 and #3 would be similar.
IP IP Logged
sri-knight22
Newbie
Newbie
Avatar

Joined: 06 Jan 2012
Online Status: Offline
Posts: 16
Quote sri-knight22 Replybullet Posted: 12 Jun 2012 at 10:41am
the totext is the part i was missing.  thank you so much.  
IP IP Logged
sri-knight22
Newbie
Newbie
Avatar

Joined: 06 Jan 2012
Online Status: Offline
Posts: 16
Quote sri-knight22 Replybullet Posted: 12 Jun 2012 at 10:50am
for the second field that I am working with how can I want to the text to read differently if the method is flat rate.  how can I make the block ready two different types of text?
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 13 Jun 2012 at 4:28am
 I am not sure of what you are asking.  Remember you can nest If statements, also there is also the Switch statement (see the help). 

I hope this helps.
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