java: compare boolean vale

I require this to limit the Print when Expression Field on Jasper Studio.

I had some trouble getting the comparison formule, because I used the typical:

$F{rfq_c} == "VALUE"

This formula did not work because it only applies when comparing strings.

After a lot of trial and error the correct formula would be:

new Boolean($F{rfq_c}.booleanValue() == true)

 

To compare a couple of strings in JasperReports (Java)

$F{issotrx}.contentEquals("Y") ? "SO #" + $F{albaran} : "PO #" + $F{albaran}

Leave a Reply

Your email address will not be published. Required fields are marked *