Hello!, How can I pass a Collection to the p_additional_params?
I've tried almost every combination.
I found the following error when running a report directly from the URL:
An error occured.
Please contact your local administrator.
net.sf.jasperreports.engine.JRRuntimeException: Invalid type java.lang.String for parameter i_creditos used in an IN clause; the value must be an array or a collection.
at net.sf.jasperreports.engine.query.JRSqlAbstractInClause.convert(JRSqlAbstractInClause.java:260)
at net.sf.jasperreports.engine.query.JRSqlAbstractInClause.apply(JRSqlAbstractInClause.java:141)
at net.sf.jasperreports.engine.query.JRAbstractQueryExecuter.applyClause(JRAbstractQueryExecuter.java:569)
at net.sf.jasperreports.engine.query.JRAbstractQueryExecuter.appendClauseChunk(JRAbstractQueryExecuter.java:563)
at net.sf.jasperreports.engine.query.JRAbstractQueryExecuter.appendQueryChunk(JRAbstractQueryExecuter.java:404)
I need to use a collection in order to make this line works:
WHERE $X{IN, numero_radicacion, i_creditos}
In my current APP, we receive the parameter as a CSV and handle the collection with the following code.
for (Map.Entry<String, String[]> entry : requestParams.entrySet()) {
String key = entry.getKey();
String value = entry.getValue()[0];
if (!key.equalsIgnoreCase("cs")) {
if (key.toUpperCase().startsWith("L_")) {
String[] split = value.split(",");
Collection<String> col = new ArrayList<>(Arrays.asList(split));
parameters.put(key, col);
allParams = allParams.concat("[" + key + "=" + col + "]");
} else {
parameters.put(key, value);
allParams = allParams.concat("[" + key + "=" + value + "]");
}
}
}
I hope you can help me so I can finish my migration to JRI.
Thanks!