Error while trying to bold a text field

0

Hi everyone, 

I'm trying to do conditional formating on a text field in the detail band by setting the extended properties (net.sf.jasperreports.style.isBold) of text field in jaspersoft studio v6.6.0,

My condition is like : $F{FieldName} == "ABC" ? true : false

It throws me an exception error  "java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String" from this i can inherit that there is some data type missmatch somewhere can someone could please help where it could be or if there is any mistake in my conditioning method.

Regards,

Adithya.

alapatiaditya369's picture
Joined: May 31 2018 - 6:13am
Last seen: 10 months 3 weeks ago

1 Answer:

0

First of all, remember than is more "happy" to use equals to compare strings instead of "=="

$F{FieldName}.equals("ABC")

Then, i tryed what you said and made it work. Just instead of returning true or false, return "True" or "False"
Regards,
GL

GonzaLinares's picture
Joined: Apr 17 2018 - 10:50am
Last seen: 10 months 19 hours ago
Feedback
randomness