I am accepting two parameter from the user through a website. $P{first_Parameter}$P{second_Parameter}<parameter name="first_Parameter" class="java.lang.String"/> <parameter name="second_Parameter" class="java.lang.String"/> I would like the following: If the $P{first_Parameter) is NULL then I would like to run SCRIPT 1Else I would like to run SCRIPT 2In the JRXML file: <queryString language="SQL"> <![CDATA[ IF ($P{first_Parameter)) == NULL then SELECT lastName, firstName, Address WHERE schoolName = $P(second_Parameter) FROM StudentTable; ELSE SELECT lastName, firstName, Address WHERE schoolName = $P(second_Parameter) and country = $P{first_Parameter) FROM StudentTable; ]]> </queryString> It would be really helpful if you guys can support me with an answer in context of JRXML file. As I didn't use the JASPERSTUDIO UI to develop the report. USED SOLUTIONS: 1 (Not Working) <queryString language="SQL <![CDATA[ SELECT lastName, firstName, Address CASE WHEN ($P{first_Parameter}=null) then (WHERE schoolName = $P{second_Parameter}) ELSE (WHERE schoolName = $P{second_Parameter} and country = $P{first_Parameter}") end ]]> </queryString> USED SOLUTIONS: 2 (Not Working) <queryString language="SQL <![CDATA[ $P{first_Parameter}.equals(null) ? " SELECT lastName, firstName, Address WHERE schoolName = $P(second_Parameter) FROM StudentTable;" : " SELECT lastName, firstName, Address WHERE schoolName = $P(second_Parameter) and country = $P{first_Parameter) FROM StudentTable;" ]]> </queryString>