• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 441
  • Last Modified:

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
0
bjennings
Asked:
bjennings
  • 5
  • 3
  • 2
1 Solution
 
peter57rCommented:
Hi bjennings,
Create a formula field to convert the entries:

@Myformulaname:

if {mytable.mybooleanfield} = true then
"Actual"
Else
"Rework"

Replace the boolean field in your report with this field.

Pete
0
 
bjenningsAuthor Commented:
I am getting closer.  The report I am using is a cross tab report and the formula will display the False value, but for some reason will not display the true value.

Do you know why it would show False, but not true?
0
 
mlmccCommented:
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
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
bjenningsAuthor Commented:
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

0
 
peter57rCommented:
bjennings,
 If {Job_Operation_Time.Rework_Time} = True
Then
"ReWork"
else
"Actual"

Pete
0
 
bjenningsAuthor Commented:
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
0
 
mlmccCommented:
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
0
 
bjenningsAuthor Commented:
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
0
 
bjenningsAuthor Commented:
I got it!!!!!

I was putting the formula in the wrong place!!

The place to add the formula is CrossTab expert....Columns---selected 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!!


0
 
peter57rCommented:
Glad you got it working.

Thanks

Pete
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now