Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Condition on report Fields Post Reply Post New Topic
Author Message
Infy123
Newbie
Newbie


Joined: 03 Jul 2007
Online Status: Offline
Posts: 2
Quote Infy123 Replybullet Topic: Condition on report Fields
    Posted: 03 Jul 2007 at 12:45pm
Hi Folks,
 
I am CR XI..I have 2 numeric Columns in Report.I want to update the Column Data based on Below Condition.
 
Let us assume report Fields Like A, B
 
Condition: if A>10 and B=10 then B='Good'(String)
else B=B(earlier data)
 
Please help me out How do I apply this logic
 
Urgent....
 
Thnaks
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 03 Jul 2007 at 1:37pm
I would create a formula and then display the formula on the report. This way you don't have to override existing data, you are just displaying the new data in a different field.

if A>10 and B=10 then
    'Good'
else
    CStr(B);

The thing you have realize is that the If statement has to return the same data type. So that is why I converted B into a string instead of leaving it as a number.
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
Infy123
Newbie
Newbie


Joined: 03 Jul 2007
Online Status: Offline
Posts: 2
Quote Infy123 Replybullet Posted: 03 Jul 2007 at 9:55pm
Hi Thanks for your help..
 
But it is giving an error like
 
" The remaining Text does not appear to be Part of the Formula" it
 
highlighting "CStr(B);"
 
Please help me out in this regard..
 
Thanks
 
 
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 03 Jul 2007 at 11:09pm
Are you using Crystal syntax? I just typed it into a dummy report and it works fine. Did you type it in exactly as it is here? Maybe you added a semi-colon after the 'Good' line? Copy and paste it here if you still get the error. 
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
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.