Multiple Functions for colouring cells

Hi, i have a formula which displays a stored value and wraps it in a span to change the colour.

({stage} == “Won” ? “


the issue i have is adding a further formula if the {stage} == “lost” how would i go about doing this?

is this a possibility in Kreporter?


when conditional statement becomes more complex than a simple if / else, best practice is to create a custom function in custom/include/custom_utils.php (create file if not present yet), pass the value in KReporter and return the formatted string.
Your function could look like
function kreporter_opportunities_stage_color($stage = “”){
case ‘Qualification’:
$stage = “< font color=‘red’>”.$stage."</ font >";
case ‘Prospecting’:
$stage = “< font color=‘blue’>”.$stage."</ font >";
return $stage;

In Formula in KReporter you would have

Please note that space I placed in font tag are only there to avoid the rendering of font tags is this post.

Thank you Val. we have this working perfectly.