Tip : Mix usage of Style creation for report and style tag in text field expression(Markup=Style) in Jasper Reports

Sadakar Pochampalli
JasperSoft BI Suite Tutorials - Sadakar Pochampalli )

On a percentage field of BigDecimal type

Display : Red if >0 , Green if <=0   (This uses Style creation for the report)
Display : DTQ text red in color based on another field of boolean type
                        (This uses style tag inside expression)

style tag for red text color  inside text field expression: 

set Markup=styled  on Text field properties , Transparent = Checked

$F{dtq}== true ? "<style forecolor='#F71C19'>DTQ</style>" :($F{max_fixed_cost_change_per}.doubleValue()*100)+"%"

NOTE : tap on the images to view in gallery mode

Style to be applied on the text field --> Style1_max_fixed_cost_change_per
Red color: $F{max_fixed_cost_change_per}.doubleValue()> new Double(0.00)
Green color: $F{max_fixed_cost_change_per}.doubleValue()<= new Double(0.00)