Forum Discussion

jnardello's avatar
jnardello
Moderator
5 months ago

Add some color to your reports

Not a problem, just thought I'd share a fun little code fragment to add some color to your reports. 

First, follow the steps in https://www.veritas.com/support/en_US/article.100056335 to allow HTML tags in your reports. 

Then you can do something like this : 

CASE 
-- Dropbox entry matches the installed version
WHEN '${freeCombo1}' like nbu_release_version THEN '<html><font size="2" color="green">Current'

-- 10.5
WHEN '${freeCombo1}' = '10.5' AND nbu_release_version LIKE '10.4.0.1' THEN '<html><font size="2" color="orange">N-1'
WHEN '${freeCombo1}' = '10.5' AND nbu_release_version LIKE '10.4' THEN '<html><font size="2" color="red">N-2'

ELSE '<html><font size="2" color="purple">Older than N-2 or newer than N'
END currency

Just thought I'd drop in some inspiration for everyone. Hope it's useful. 

 

1 Reply

  • FWIW, you can also do this with the Status Icon formatter and not having to enable HTML and risking an XSS issues

    as an example, if you put this in your query:

         DECODE(MIN(summary_status),0,'green' ,1,'yellow',2,'red' )

    you can have the status icons for any field similar to below

    *** you dont have to use decode, you can use case statement or other SQL.  The point is, the formatter will understand the colors  and put the appropriate icon.  

    In jnardello​ example, its useful when wanting to change the color of the text in the field.