bjennings
asked on
Crystal Reports 9 --Change a boolean on a report
Hello,
I have a boolean in a report that shows up either False or True. What I want to do is have it be displayed as "Rework" and "Actual".
Is there anyway to do that?
Thanks,
Bill
I have a boolean in a report that shows up either False or True. What I want to do is have it be displayed as "Rework" and "Actual".
Is there anyway to do that?
Thanks,
Bill
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Is it really a boolean or is it a string?
A boolean
@Myformulaname:
if {mytable.mybooleanfield} then
"Actual"
Else
"Rework"
A string
@Myformulaname:
if {mytable.mybooleanfield} = 'True' then
"Actual"
Else
"Rework"
If those don't work show the formula you are trying to use.
mlmcc
A boolean
@Myformulaname:
if {mytable.mybooleanfield} then
"Actual"
Else
"Rework"
A string
@Myformulaname:
if {mytable.mybooleanfield} = 'True' then
"Actual"
Else
"Rework"
If those don't work show the formula you are trying to use.
mlmcc
ASKER
I am running a crosstab report to give me all the hours work hours in a month and to also give me the rework hours.
The right now, the totals look like this
FALSE TRUE TOTAL
1000 150 1150
Now, using your formula filed; it just shows "Actual", I then went into the column Field and put the formula in the "display String". Now it comes out like this:
Actual Actual Total
1000 150 1150
This is the formula I used
If {Job_Operation_Time.Rework _Time} = False
Then
'Actual'
Else If {Job_Operation_Time.Rework _Time} = True
Then
'ReWork'
I even tried This
If {Job_Operation_Time.Rework _Time} = True
Then
'ReWork'
Then it will come out blank.
It is a boolean field.
Thanks,
Bill
The right now, the totals look like this
FALSE TRUE TOTAL
1000 150 1150
Now, using your formula filed; it just shows "Actual", I then went into the column Field and put the formula in the "display String". Now it comes out like this:
Actual Actual Total
1000 150 1150
This is the formula I used
If {Job_Operation_Time.Rework
Then
'Actual'
Else If {Job_Operation_Time.Rework
Then
'ReWork'
I even tried This
If {Job_Operation_Time.Rework
Then
'ReWork'
Then it will come out blank.
It is a boolean field.
Thanks,
Bill
bjennings,
If {Job_Operation_Time.Rework _Time} = True
Then
"ReWork"
else
"Actual"
Pete
If {Job_Operation_Time.Rework
Then
"ReWork"
else
"Actual"
Pete
ASKER
I tried the following:
If {Job_Operation_Time.Rework _Time} = True
Then
"ReWork"
else
"Actual"
Still just shows up as "Actual"...Weird, it does not want to show a true value. If I take out all the formulas it will show both true and false
If {Job_Operation_Time.Rework
Then
"ReWork"
else
"Actual"
Still just shows up as "Actual"...Weird, it does not want to show a true value. If I take out all the formulas it will show both true and false
Have you tried my suggestion without the comparison and just use it as a boolean?
If {Job_Operation_Time.Rework _Time} Then
"ReWork"
else
"Actual"
mlmcc
If {Job_Operation_Time.Rework
"ReWork"
else
"Actual"
mlmcc
ASKER
I tried it and it did not work.
Once the formula sees a false record it does not change after that. I ran a filter to show only True Records and then "Rework" is displayed, but if I want to see both False and True, just "Actual" is displayed
Once the formula sees a false record it does not change after that. I ran a filter to show only True Records and then "Rework" is displayed, but if I want to see both False and True, just "Actual" is displayed
ASKER
I got it!!!!!
I was putting the formula in the wrong place!!
The place to add the formula is CrossTab expert....Columns---select ed the field----Group Options----Options--"Use Formula as a group name" I added the formula and now everything comes out perfect!!
Thanks for all your help in the formula. I have not used Crystal since version 7, so I am a little rusty!!
I was putting the formula in the wrong place!!
The place to add the formula is CrossTab expert....Columns---select
Thanks for all your help in the formula. I have not used Crystal since version 7, so I am a little rusty!!
Glad you got it working.
Thanks
Pete
Thanks
Pete
ASKER
Do you know why it would show False, but not true?