I am going to generate reports using jasper reports. For that, my plan is,
What I need to know is the possibility of this. Can I set my variables into the fields in my jrxml file?
You need to define the parameter as a "Parameter" type in the report, then supply the parameter as the "Text Field Expression" on the form in the format
Then, when you want to fill the report, you need to do is create a
Map of some kind, each key in the map should be the name of parameter your defined in the report, for example...
Map<String, Object> mapParameters = new HashMap<String, Object>(5); mapParameters.put("USER_NAME", name); JasperPrint print = JasperFillManager.fillReport(report, mapParameters);