imrohithsnair Posted August 27, 2019 Share Posted August 27, 2019 The clause is used to check whether a particular value is present in a discrete set of values. Here is an example:SELECT * FROM ORDERS WHERE SHIPCOUNTRY IS IN ('USA','Italy','Germany')The set here is defined by the countries USA, Italy and Germany. Assuming we are passing the set of countries in a list (or better a java.util.Collection) or in an array, the syntax to make the previous query dynamic in reference to the set of countries is:SELECT * FROM ORDERS WHERE $X{IN, SHIPCOUNTRY, myCountries}where myCountries is the name of the parameter that contains the set of country names. The $X{} clause recognizes three parameters:Type of function to apply (IN or NOTIN)Field name to be evaluatedParameter nameAbove example works perfectly...My questions is?how to dynamically change Field name by passing parameter?i have tried by passing parameter for field name $P{...} but couldn't Link to comment Share on other sites More sharing options...
swood_1 Posted August 30, 2019 Share Posted August 30, 2019 Given the way the $X function works, there is no way to parameterize the column name.You would have to either change the $X logic within JasperReports, or generate your own SQL expression with $P!{} Link to comment Share on other sites More sharing options...
imrohithsnair Posted August 31, 2019 Author Share Posted August 31, 2019 tnq u :-) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now