Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: color formatting Post Reply Post New Topic
Author Message
Tori_Dee
Newbie
Newbie


Joined: 25 Jun 2018
Online Status: Offline
Posts: 6
Quote Tori_Dee Replybullet Topic: color formatting
    Posted: 27 Sep 2018 at 7:26am
Hi,

The field {flaglevel} is a string that pulls in a number.
I am creating a color formatting formula for the field {nresult} which is a number.

I currently have this formula in the x-2 next to color in {nresult} :
If {PRM_SxData.nResult} > tonumber({PRM_SxData.FlagLevel})
then crRed
Else crBlack

I am using the same formula in (@violation) with a minor change:
If {PRM_SxData.nResult} > tonumber({PRM_SxData.FlagLevel}) then "!"
Else " "

//On our report wherever there is red result there needs to be an "!" to better alert clients in case they print the report in b&w.

The formulas work like a charm except we noticed that sometimes {flaglevel} populates with 0.
In this case I want {nresult} to be crblack even if {nresult} is >0 because 0 is not important.

so if {flaglevel} populates >0 then {nresult} needs to be red and (@violation) needs to return "!".
if {flaglevel} populates =0 then {nresult} needs to be black and (@violation) needs to return nothing.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 01 Oct 2018 at 5:57am
I would change the "If" part of your formulas to this:

If (tonumber({PRM_SxData.FlagLevel}) > 0) and ({PRM_SxData.nResult} > tonumber({PRM_SxData.FlagLevel}))

-Dell
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.