Create a map containing the parameters and place the parameters as a key value pair.
Map parametersMap = new HashMap(); parametersMap.put("id",7);
When creating a Jasper report from JSP:
JasperPrint jasperPrint = JasperFillManager.fillReport( jasperReport, parametersMap, jdbcConnection);
where the keys in the parametersMap shoud will exactly match the parameters defined in the report template.
So, declare the parameter in the report template (jrxml):
<parameter name="id" class="java.lang.Integer"/>
Skip parameter in query in Jasper report
select * from personal where id= $P{id}
source share