To set parameters from Java, you have to put them in your params
object.
Map<String, Object> params = new HashMap<String, Object>();
params.put("paramName",value);
JasperReport report = JasperCompileManager.compileReport("path\\to\\jrxml");
JasperPrint print = JasperFillManager.fillReport(report, params, new ItemData(keys));
and then use it in the report like $P{paramName}. Make sure, when you declare the parameter in the report to have the same name ('paramName') and that its class is the class of your value
object.
If you want to use IN clause, you will have to use built-in SQL Clause Functions provided by Jasper.
The format is $X{IN, <column_name>, <parameter_name>}
(make sure to use, in this case, just the name of the parameter, without $P).
So, in your case, the query would be:
SELECT * FROM StockInventory WHERE $X{IN,pk,paramName}
'paramName' parameter can be either a java.util.Collection instance or a java.util.List instance.