ericy Posted February 3, 2010 Share Posted February 3, 2010 Hi,My main report uses a subreport that takes in a List<int> as parameter. I want to be able to pass in a list of Integers from the main report to the subreport. The integer list is the result of a query that needs to be passed to the List<int> parameter of the subreport.How do I do this in iReport?Any help will be greatly appreciated.Eric Link to comment Share on other sites More sharing options...
madhukiran Posted February 3, 2010 Share Posted February 3, 2010 ->You need to define a parameter of type java.util.List say p1->then you have to create a variable which is of type java.lang.Boolean and its expression isnew Boolean($P{p1}.add($F{your_field_from_query})keep the rest type as report so that all the values from the field get added into the para p1--> now use it in your where clause as follows:where $X{IN,col_name,p1} the only issue with this is that parameter p1 wont get initiated and wud throw null,unless u make it as a prompt and click ok when it prompts.. im not able to initiate the type list.. any help on that from anyone???? Link to comment Share on other sites More sharing options...
madhukiran Posted February 3, 2010 Share Posted February 3, 2010 madhukiranWrote: ->You need to define a parameter of type java.util.List say p1 ->then you have to create a variable which is of type java.lang.Boolean and its expression is new Boolean($P{p1}.add($F{your_field_from_query}) keep the rest type as report so that all the values from the field get added into the para p1 --> now use it in your where clause as follows: where $X{IN,col_name,p1} the only issue with this is that parameter p1 wont get initiated and wud throw null,unless u make it as a prompt and click ok when it prompts.. im not able to initiate the type list.. any help on that from anyone???? ok..for the default value of the para.. jsut give new ArrayList() 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