Hello All ,
I have a jasperDesign object where i am looping the elements of the details band and i am filling the properties map of a specific JRTextField as following
JRTextField textField = (JRTextField) element;
textField.getPropertiesMap().setProperty("PropName","PropVal");
After compiling the jasperDesign and getting the JasperPrint object , i looped the elements of the JasperPrint but when i retrieved the value of the previous texfield wich is now a JRTemplatePrintText object ,i found the properties map is null
My question is how can i set a property for a specific element in jasperDesign and get this value from the jasperPrint ?
Thank you in advance
2 Answers:
Properties are not automatically transferred to print object, you'll need to configure a property that provides a prefix for properties to be transferred. E.g. add the following to your jasperreports.properties
net.sf.jasperreports.print.transfer.my.props=my.prefix
and then set my.prefix.* properties to elements.
Regards,
Lucian