MikeM19 Posted August 24, 2015 Share Posted August 24, 2015 Hello everybody,i just created a very simple report where i extract a bunch of attributes from a table based on a WHERE condition like this:WHERE field_name = $P{string parameter}Everything works fine but now i need to make another report using a multi selection list input control so the user can select more than one attribute to match the field name, i can create the input control on jasperserver but when i run the report it display that the report is empty even if i select just one option, can anybody put me on the right direction about this, the report is created on Ireports.Best regards! Link to comment Share on other sites More sharing options...
joel.carlson Posted August 25, 2015 Share Posted August 25, 2015 The where clause changes when doing more of an IN statement. It would be Where $X{IN,field_name,string parameter} but the Parameter Class needs to be changed from a string to a java.util.Collection. Defaults can be assigned there as well.This is one I use:Where $X{IN,agent_name,agent_namelist}agent_name is my table column and agent_namelist is the parameter I use as a collection for the in statement. Link to comment Share on other sites More sharing options...
MikeM19 Posted August 25, 2015 Author Share Posted August 25, 2015 I just have to say, you saved my life today, it works perfectly thank you so much Joel. Regards! Link to comment Share on other sites More sharing options...
joel.carlson Posted August 25, 2015 Share Posted August 25, 2015 The where clause changes when doing more of an IN statement. It would be Where $X{IN,field_name,string parameter} but the Parameter Class needs to be changed from a string to a java.util.Collection. Defaults can be assigned there as well. This is one I use: Where $X{IN,agent_name,agent_namelist} agent_name is my table column and agent_namelist is the parameter I use as a collection for the in statement. Link to comment Share on other sites More sharing options...
joel.carlson Posted August 25, 2015 Share Posted August 25, 2015 No problem Mike, someone else just saved mine so it all goes around. Glad to help, had the same issue and struggled through that one. 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