Problem using IN clause in iReport SQL

Good afternoon from Gran Canaria.

I have a big problem with a report whose query uses an IN statement in the WHERE clause.
I´m passing an array parameter and, in iReport, is defined as java.util.Collection, the WHERE clause is:

WHERE lineas_repartos.idreparto = $P{nReparto} AND $X{IN, establecimientos.idruta, aRutasImprimir}

I have made sure that the SQL works without the IN staement so the SQL is not the problem.

Anyone could help me please?

Check out this thread on the iReport forum regarding setting default values for parameters for the java.util.Collection class type:

http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=31690

I cannot tell, but is '‘aRutasImprimir’ the iReport parameter name or the name of the array you are passing? It should be the parameter name.

I hope this helps!

Thanks Kim.

Yes it is the name of the parameter, but anyway I got it working now.

The problem was that the array was created with a check field that shows a value list. I did not took into account that each array value was a string :oops: as soon as my stupid brain saw that I solved.

Thanks anyway.