1
I have the following problem: I created in java a selectcheckbox
, where the person will select multiple objects; when sending to the managed bean
, I can receive these listed objects. I now want to send as a parameter to ireport
for it to generate a report with the information that was selected.
In the other methods 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.imprimirRelatorioPdf" does everything; if I use code it prints normal. So I thought: there in my sql do ireport
, instead of using the
WHERE agencias.`id` = $P{codigo}"
use the
WHERE agencias.`id` IN $P{codigo}"
Then in this parameter "code" I would pass a string with the id of the agencies I want to print: it would be "Where agencies in "1,2,3"
but this does not work, gives syntax error.
How could I do that?
Adriano, consider explaining your answer. It may be that for you the code is easy to understand, but for others, without an answer with details, it’s the same thing as copying and pasting.
– Bruno Rigolon