shravanthit Posted July 6, 2012 Share Posted July 6, 2012 Hello all,I just started experimenting with Jasper for a project requirement and stuck on the below issue.How do we access values of a bean sent as parameter to Jasper Report?I have to display the data of a model (which is not a collection) in Jasper Report. I pass the model to the Jasper Report in parameters in a Map.Map<String,Object> params = new HashMap<String,Object>();params.put("object", object);[/code]Now this object has fields whose data I need to display in the Jasper report header section.like in jsp we do ${object.name}, ${object.phone} etc., how do we achieve this in Jasper Report.I tried doing $P{object.name} but it doesn't work. Can anyone please let me know how to achieve this.Thanks in advance.Laxmi. Link to comment Share on other sites More sharing options...
sanbez Posted July 9, 2012 Share Posted July 9, 2012 $P{object}.getName() Link to comment Share on other sites More sharing options...
rzandonai Posted July 10, 2012 Share Posted July 10, 2012 Map<String, Object> params = new HashMap<String, Object>(); params.put("object", "teste"); for (Map.Entry<String, Object> params2 : params.entrySet()) { String Key = params2.getKey(); Object val = params2.getValue(); } i think this can help you Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now