2006 IR Open Dicussion Posted September 5, 2006 Share Posted September 5, 2006 By: Craig Butts - craigbutts Passing Parameter to a JavaBean datasource 2006-05-02 13:59 I have developed a report based on a JavaBean and now I need to be able to pass a parameter to the JavaBean. Is there a way in iReport to do this? By: N Olding - oldingn RE: Passing Parameter to a JavaBean datasourc 2006-05-02 14:13 Use a HashMap, and pass it as a parameter to the Fill call. Here's an example that passes today's date as a parameter, plus a bean with some other data: Map inputParameters = new HashMap(); inputParameters.put("today", new Date()); APJasperRptBean bean = new APJasperRptBean(); bean.setAddr1(addr1); bean.setAddr2(addr2); bean.setAddr3(addr3); APJasperRptBean[] beans = new APJasperRptBean[1]; beans[0] = bean; JRDataSource jds = new JRBeanArrayDataSource(beans); jasperPrint = JasperFillManager.fillReport(jr, inputParameters, jds); Hope it helps. N. By: Craig Butts - craigbutts RE: Passing Parameter to a JavaBean datasourc 2006-05-02 15:03 N, Thank you for your response, this answers a question I had about how to fill the parameter when I go to deploy the report. However, I should have been clearer in my request. Is there a way - while in the iReport tool - to pass a parameter to the javabean? I found an article [12341537] that indicates states the JavaBean factory method cannot contain parameters. This article was from 2004. Is this still a limitation as this is what I am really trying to do. Thanks again for your response - the information does help me for a later point in my development. Sincerely, Craig... Link to comment Share on other sites More sharing options...
tulsi Posted July 31, 2012 Share Posted July 31, 2012 hi ,did u find any way for this i really need this same thing parameter in ireport for javabean. any reference or tutorial for this. Thanks in advance Post Edited by tulsi at 07/31/2012 08:35 Link to comment Share on other sites More sharing options...
djt Posted August 9, 2012 Share Posted August 9, 2012 I have the same problem..The SQL is not powerfull enough to match my need and if the JavaBean datasource has no way to receive parameters then i don't know what it can be used for...So, if someone find a way to pass params to a JavaBean datasource, i'm really really interested, or i will have to fine another reporting tool :( Link to comment Share on other sites More sharing options...
kavi_mathi Posted March 28, 2014 Share Posted March 28, 2014 Is there any way in 5.5 to pass paramters to JavaBean method? 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