Hello everybody,
I'm using a table component to display a wide range of data. This data is catagorized by ID's and some categories should be displayed with bold text. For example the first row is Category 1 and Category 1 should be printed with bold text. The row of Category 2 than should be formatted with normal style. So there a some single rows in the table that should be printed with bold text. What is the best way to realize that? I try this bit it did not bring a change:
($F{Param1} == "1") ? "<style isBold='true'>" + $F{Param2} + "</style>" : $F{Param2}
Thanks for any hint!
1 Answer:
I would check out conditional styles in Studio. You can add styles with conditions (which can be Java checks against fields such as your examples). Then, you simply set the Style property for the field you want dynamically displayed to the Style you created. More details here: https://community.jaspersoft.com/wiki/how-apply-conditional-formatting-y...
Did no one have an idea how making text for special categories bold can work in jaspersoft?
In this case the equality check with object.equals(object) solves the issue. Like this: `($F{Param1}.equals("1"))`