I have a .jrxml file and I would like to pass some params from the code to it. I have an Orde
r class that has fields like double price
, int quantity
and Product product
. The situation is simple, when i need to pass price or quantity, I just do something like this:
<textFieldExpression class = "java.lang.Integer">
<![CDATA[$F{quantity}]]>
</textFieldExpression>
The problem appears when I try to pass product.getName()
. I tried something like:
<textFieldExpression class = "java.lang.String">
<![CDATA[$F{product}.getName()]]>
</textFieldExpression>
and many others but I keep getting error: net.sf.jasperreports.engine.design.JRValidationException: Report design not valid : 1. Field not found : product
Do you have any idea how to solve this problem?