I am using iReports to generate some reports in my project .
I am using this line to fill the report with the parameters
JasperPrint jasperPrint=JasperFillManager.fillReport(jasperReport,paramMap,conn);
where jasperReport is an Object of JasperReport
and I have a Map
object paramMap
which has a key names conditionals that carry the condition statement which I want to append in the query written in jasper Report.
Without condition the query is working fine in the reports
Select * from myTable WHERE 1=1
My condition carry multiple filter and I checked its generating properly fine and I append it to my query and run in my db enviornment properly.
The query which I use to add condition gives me a little bit of confusion.I add like this in report
SELECT * FROM MYTABLE WHERE 1=1 $P{conditionals}
I am not sure when this condition will executed and how to put this to run everytime.