Jump to content
We've recently updated our Privacy Statement, available here ×

How to fill the PropertiesMap of JRTemplatePrintText in jasperprint from jasperdesign using java


NOjeil

Recommended Posts

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

 

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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

Link to comment
Share on other sites

  • 3 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...