passing SQL "IN" parameter list in jasperreport

The examples linked to in the accepted answer don't come up for me.

An alternative that worked for me is instead of using:

...
WHERE customer_role IN ($P{roles})

I used this:

...
WHERE customer_role IN ($P!{roles})

And for the roles variable I pass in a String containing one or more values, each in single quotes, separated by commas (e.g., '1','2','3').

See here for reference.


Jasper Report has a special variable $X for that:

select * from customer where $X{IN,customer_role,roles}

should work. See here and here.