How to Apply Conditional Style on Jasper Main Report Variable

We have a variable on main report, and this variable's value depends on subreport's aggregation value.

Now we add a text field and its expression is the variable abovementioned, then how to apply conditional style on this text field?

In short, you need to add a report level property in your report XML source code.

<property name="net.sf.jasperreports.style.evaluation.time.enabled" value="true"/>

Very neat solution it is! the underlying principle is the setting causes a Conditional Style to be performed at the moment at which the element is evaluated.

Reference:

[1] http://stackoverflow.com/questions/12269736/using-variables-in-conditional-style




你可能感兴趣的:(How to Apply Conditional Style on Jasper Main Report Variable)