mpolo91 Posted January 19, 2023 Posted January 19, 2023 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}[/code]Thanks for any hint!
mpolo91 Posted January 23, 2023 Author Posted January 23, 2023 Did no one have an idea how making text for special categories bold can work in jaspersoft?
Michael Bielkiewicz Posted February 16, 2023 Posted February 16, 2023 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-your-text-fields
mpolo91 Posted February 16, 2023 Author Posted February 16, 2023 In this case the equality check with object.equals(object) solves the issue. Like this: `($F{Param1}.equals("1"))`
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now