Category Archives: iReport
iReport: Applying Condition depending on the parameter value passed
i had the problem like i want to keep the where condition depending on the value of parameter is pass. i tried different things, and final got through with following solution. select * from deptartment where (CASE WHEN $P{param_dept_codice} = -1 THEN true ELSE dept_codice = $P{param_dept_codice} END) above query displays all the records from [...]
iReport: Condition Expression ?:
in ireports we can write condional expression depending on the parameter passed. here is the example. $P{param_codice}.equals( new java.lang.Long(-1) ) ? “” : $F{field_descrizione}
iReport: Date field without time
when we retrive fields of table from database, for the Date field in database, it will consider java.util.Date in ireport. and displaying of Date will be somewhat like “2009-05-29 00:00:00″ if you dont want to display “hour,minute and seconds”, then change the Expression Class property to java.lang.String. after that it will display ’2009-05-29″
iReport: passing multiple values for parameter
in where condition we can use like below… select * from dept where dept_name in ($P!{dept_name_list}) from console window you can pass value for dept_name_list as ‘AAA’,’BBB’