Jump to content
JasperReports Library 7.0 is now available ×

Recommended Posts

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

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...