Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Format Colors Post Reply Post New Topic
Page  of 2 Next >>
Author Message
rculbertson
Newbie
Newbie
Avatar

Joined: 31 Mar 2018
Location: United States
Online Status: Offline
Posts: 7
Quote rculbertson Replybullet Topic: Format Colors
    Posted: 04 Apr 2018 at 10:49am
I am currently building a report with the the following formula:

if {TrainingObjectiveHistory.tohobjTitle} = "iso facility use hours" and {TrainingObjectiveHistory.tohseshrs} <18 then crred

The formula has no errors but it does not turn totals <18 red but turns all numbers red. I need it to only turn <18 red.
Rculbertson
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Apr 2018 at 8:24am
if the <18 condition supposed to be based on a group or report SUM?
IP IP Logged
rculbertson
Newbie
Newbie
Avatar

Joined: 31 Mar 2018
Location: United States
Online Status: Offline
Posts: 7
Quote rculbertson Replybullet Posted: 05 Apr 2018 at 8:35am
Report sum
Rculbertson
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Apr 2018 at 8:54am
Your current formula is a row level analysis of the value of that field on that row.
If you want the sum to be highlighted use the below formula on the sum field.

if {TrainingObjectiveHistory.tohobjTitle} = "iso facility use hours" and SUM({TrainingObjectiveHistory.tohseshrs}) <18

Although I think you still have an issue because this would be the the total sum and not the sum where the row is like the "iso..." condition. If you are trying to that you need to use a conditional running total or another formula field that you would sum.

//iso_only formula
if {TrainingObjectiveHistory.tohobjTitle} = "iso facility use hours" then {TrainingObjectiveHistory.tohseshrs} else 0

sum that to see if it is <18
SUM(@iso_only)
IP IP Logged
rculbertson
Newbie
Newbie
Avatar

Joined: 31 Mar 2018
Location: United States
Online Status: Offline
Posts: 7
Quote rculbertson Replybullet Posted: 05 Apr 2018 at 9:28am
The {TrainingObjectiveHistory.tohobjTitle} has different title like the "iso facility use hours".

The top formula you had changed all colors.

I am looking to just change the {TrainingObjectiveHistory.tohobjTitle} titled "iso facility use hours" a color and not the rest.
Rculbertson
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Apr 2018 at 10:19am
so you want to change the font color of tohobjTitle field?
You want the field to be red when what the title value = 'iso facility use hours' and the sum of all tohseshrs < 18 or only if the sum of the tohseshrs rows where title = 'iso facility use hours' < 18?
IP IP Logged
rculbertson
Newbie
Newbie
Avatar

Joined: 31 Mar 2018
Location: United States
Online Status: Offline
Posts: 7
Quote rculbertson Replybullet Posted: 05 Apr 2018 at 10:24am
only if the sum of the tohseshrs rows where title = 'iso facility use hours' < 18

And then for other titles I would do the same for the required hours for each
Rculbertson
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Apr 2018 at 2:34am
Create a formula field you will use to get the sum where only title = 'iso facility use hours'
call it something like "iso_facility_use_hours_only".
it will be
if {TrainingObjectiveHistory.tohobjTitle} = "iso facility use hours" then {TrainingObjectiveHistory.tohseshrs} else 0
now you will sum that formula field
for the color condition it will be

if {TrainingObjectiveHistory.tohobjTitle} = "iso facility use hours" and sum(@iso_facility_use_hours_only)<18 then CrRed else CrBlack

Or you might consider grouping on tohobjTitle and using the group level sum but that will possibly change your sort order or structure too much for whatever else the report is for.
IP IP Logged
rculbertson
Newbie
Newbie
Avatar

Joined: 31 Mar 2018
Location: United States
Online Status: Offline
Posts: 7
Quote rculbertson Replybullet Posted: 06 Apr 2018 at 9:02am
Not working but thank you.
The
if {TrainingObjectiveHistory.tohobjTitle} = "iso facility use hours" and sum(@iso_facility_use_hours_only)<18 then CrRed else CrBlack

Is saying its missing a )
Rculbertson
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Apr 2018 at 10:02am
can you copy and paste the exact text you are using for that condition format
IP IP Logged
Page  of 2 Next >>
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.008 seconds.