jasper report ireport 3.6.1 passing a parameter for a where clause
posted 3 years ago
I created a jasper report to get some data without any where clause and call the report from a java application. Now, i need to add some criteria so that i can get a single report instead of a whole batch.. For example, i want to select a report based on a lastname. I am at a loss as to how to do that.
First, in iReport, if i select the report query, i see my query:
"select namelast, namefirst,namemiddle, FORMATTEDNAME , employeetimebase, employeecbid,workweekgroup,last4ssn,bur, position_number from table order by bur,namelast,namefirst,namemiddle".
Now i want to insert a where clause for the last name for example. In ireports, I see a filter expression that shows a pane with list of fields, parameters and so on. The middle pane for the parameters has a report_parameter_map item. I think i need to use that since my java code uses a call JasperFillManager.fillReport(...) that passes a hashmap. I have searched on the web but nothing has been very helpful to me.
I am not sure how to set up the parameters in the report template using the expression editor. I hope that once i set this up properly then all i will need is to make the call fillreport and pass a proper hashmap and it should work.
Any ideas on how to set up the where clause in the iReports template query with the report_parameters_map? Maybe report_parameters_map is not the proper selection i should be using.