I’m using the struts2 jasperreports plugin and it works well. The problem is that I want to pass exportParameters and I’m not sure how to do that through the plugin.
I’m using the struts2 jasperreports plugin and it works well. The problem is that
Share
Which version of Struts2 you are using starting with
2.1.2+it provides the feature to providesexportParametersAll you need to add following entry or similar entry in your struts config file inside your action class
exportParameters - OGNL expression used to retrieve a map of JR exporter parameters from the value stack. The export parameters are used to customize the JR export. For example, a PDF export might enable encryption and set the user password to a string known to the report creator.All you need to define a map for your export parameters in your action class and provides its getter/setter than use its reference as described.
For details refer this URL
jasperreports
Here is how they have done it in result type
so what they did is they tried to find out a
mapin value stack with nameexportParametersif they find it they are adding it.So have to do this in your action classset your properties in this map and create a getter and setter for this property
and in your struts config file declare the map as follows
rest framework will take care
Hope this will help you