Jump to content
We've recently updated our Privacy Statement, available here ×
  • Tip : Mix usage of Style creation for report and style tag in text field expression(Markup=Style) in Jasper Reports


    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)

    expected.png

    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)
    red.png
    Green color: $F{max_fixed_cost_change_per}.doubleValue()<= new Double(0.00)

    green.png


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...