Print negative numbers in red

Hi! How to print negative numbers in report ? Maybe some template if someone have or code ? Thank you!

What have you tried so far?

Should be as easy as…

[code]
IF Fil:Variable < 0
SETTARGET(Report)
?Fil:Variable{Prop:Color,3} = Color:Red ! Check this
SETTARGET
END

1 Like

Thank you! Only problem is that I have 50 variables in report so your code x 50. Thank you again!

You might write it this way.

Report$?Fil:Variable{PROP:FontColor} = CHOOSE( Fil:Variable < 0, COLOR:Red, COLOR:Black )

I’m not sure about the property being set.
I think {PROP:Color,3} is { PROP:SelectedFillColor} and that’s not valid in a report

You could also write a function

 SETTARGET(Report)
 RedWhenNegative( ?Fil:Variable )
 RedWhenNegative( ?Fil:Variable2 )
 RedWhenNegative( ?Fil:Variable3 )
 SETTARGET()

RedWhenNegative PROCEDURE( SINGED xFEQ )
  CODE
  IF CONTENTS( xFEQ ) < 0
       xFEQ{PROP:FontColor} = COLOR:Red
  ELSE xFEQ{PROP:FontColor} = COLOR:Black
  END
2 Likes

Thank you for your help !!!