I have the following problem: I created in Java a selectcheckbox
, where the person will select several objects; when I send to managed bean
, I get these objects listed. Now I want to send as a parameter to ireport
to generate a report with the information that was selected.
In the other methods I use the following:
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("codigo", agencias.getId());
JasperImpressao jp = new JasperImpressao();
jp.imprimirRelatorioPdf(parameters, "agencia.jasper");
This "jp.printRelatorioPdf" does everything; if I use code it prints normal. So I thought: there in my sql of ireport
, instead of using
WHERE agencias.'id' = $P{codigo}"
use
WHERE agencias.'id' IN $P{codigo}"
Then in this parameter "code" I would pass a string with the agencies id I want to print: it would be "where agencies in" 1,2,3 "
But this does not work, it gives syntax error.
How could I do this?