giuliana.damiani Posted February 5, 2014 Share Posted February 5, 2014 Hi,I have a problem with passing values from a input control to an other. In particolar the first input control PARAM1 is a multi-select query (type: java.util.Collection) and it returns the following value: [11,22,33]. The values are integer ! Now, this values enter in the query in the second input control like this $X{IN,cast(attribute(integer) as varchar(255)),PARAM1}. This expression work in the query report, but don't in the query of the input control? Why? Is there the possibility to transform the PARAM1 type from java.util.Collection to java.util.String? This could solve the problem. There is someone who can help me? Thank you very much. Link to comment Share on other sites More sharing options...
sadakar Posted October 28, 2014 Share Posted October 28, 2014 java.lang.Integer should work for multi select parameter.I have tested. by inputting integer values to select mutlple. ( Where we generally assume mutli select should take collection but with integer values we have to take java.lang.Integer for parameter instead java.util.Colleciton).from 4.7 and greter versions this supports. . We need not to cast in WHERE clause syntax of multi select. Thank you.Sadakar Link to comment Share on other sites More sharing options...
giuliana.damiani Posted October 30, 2014 Author Share Posted October 30, 2014 Thank you so much Sadakar for your help! I set the parameter type to integer and it works,but if I want to pass it to a subreport or to a dataset it doesn't work. Now with Jasperstudio 5.6.2 I solve this issue: you can specify the type of collection.In my case the type is integer and it Works perfectly with the subreport and dataset. Best Regards, Giuliana Link to comment Share on other sites More sharing options...
mailtojustine Posted December 8, 2015 Share Posted December 8, 2015 I tried this way and used Integer instead of collection in parameter. Now I am getting a new errorjava.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.IntegerCan anyone help me resolve this issue? 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