Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: declaring a value Post Reply Post New Topic
Author Message
maciaso
Newbie
Newbie
Avatar

Joined: 20 Mar 2008
Location: United States
Online Status: Offline
Posts: 11
Quote maciaso Replybullet Topic: declaring a value
     Posted: 04 Nov 2008 at 4:49am
Hi,
 
I would like to assign a status for any record whose {wr.cause_type} = 'PROJECT' Then {wr.status} = 'project' to include it in my record selection
 
If {wr.STATUS} = 'R' Then 'Requested' Else
If {wr.STATUS} = 'Rev' Then 'Reviewed but On Hold' Else
If {wr.STATUS} = 'Rej' Then 'Rejected' Else
If {wr.STATUS} = 'A' Then 'Approved' Else
 
any suggestions
 
OM
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 06 Nov 2008 at 2:35pm
You could use a stored procedure, then your information can be in your data. 
 
If you need it in the record selection, I wouldn't worry about the reseting the value, I would just decide if the value is be included or excluded from the record set. 
 
Once the record set is correct, write a formula to display the values that you want to see.
 
Hope this helps
IP IP Logged
maciaso
Newbie
Newbie
Avatar

Joined: 20 Mar 2008
Location: United States
Online Status: Offline
Posts: 11
Quote maciaso Replybullet Posted: 07 Nov 2008 at 10:10am
I tried it and no luck
 
This is what I got going and is not working either.  The total count is ommiting recoreds with null values
 
 
not ({wr.prob_type} in ["PREVENTIVE MAINT", "LIFE SAFETY", "MOVES", "EVENTS - MOVES", "EVENTS", "ASSESSMENT"]) and
iif(isnull({wr.cause_type}) = True,"PROJECT",{wr.cause_type}) = "PROJECT"
OM
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 07 Nov 2008 at 10:23am
Hmmm.  Looks like the statement return a true when prob_type is not in the list and the cause_type is null or PROJECT.  I am assuming that the record is printing so the count doesn't match the detail...have you tried setting the option to convert database null to default (File/Options/Reporting)?   Have you tried counting a different field that is not null?
 
I would have thought that if the record there that Crystal would count it.
 
I don't use counts too often, usually I sum, and I mainly use stored procs, so don't have too many issues like this.
 
Hope this helps
IP IP Logged
maciaso
Newbie
Newbie
Avatar

Joined: 20 Mar 2008
Location: United States
Online Status: Offline
Posts: 11
Quote maciaso Replybullet Posted: 07 Nov 2008 at 10:58am
I did change the preferences and I got nothing...
OM
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 07 Nov 2008 at 11:11am
Sorry, out of ideas.
 
Oh, here is my last one.  Create a shared variable and update it for every record printed.  Reset it at the appropriate group change.  You can report on it as needed.
 
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