fabridp Posted July 3, 2009 Share Posted July 3, 2009 Hello all,I pass to the report a parameter "list" of type arraylist.Ho can I utilize it in query for stamenteWHERE FIELD IN (elements of list)? Thanks in advance Link to comment Share on other sites More sharing options...
lukus Posted July 5, 2009 Share Posted July 5, 2009 Hi There, I'm using a JasperFillManager.fillReport to create the report. To make this work I am passing in a hashmap. eg.Create the parameter in iReport or your XML doc (in this case 'ITEM_ID')Map parameters = new HashMap();parameters.put('ITEM_ID', '15846');JasperFillManager.fillReport(jasperReport, parameters, dataSource); When this is done your parameter should be available for use in your query at report launch time. You can reference it like this... SELECT item, otheritemdetailFROM itemsWHERE id = $!P{ITEM_ID} Be sure to include the '!' in the parameter reference or else it will enclose its value in "". Hope this helps. Code: 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