revived_muffin Posted January 21, 2016 Posted January 21, 2016 I have created a report where users can select multiple values that correspond to specific database values in a query on JasperReports Server. The parameter that the report uses is a class java.lang.String and it is incorporated into a SQL query using $X{IN, databaseField, parameterName} in the WHERE clause. Is there a way that I can print the list of values selected by the user in the report?
cameronfdowner Posted January 23, 2016 Posted January 23, 2016 A java.lang.String cannot be used within a IN clause function. A single string cannot hold more than one value. I suggest changing the input parameter to a java.lang.String[] (A string array) and then sending an string array of the user selected values.I know that somethings java.lang.String[] can cause problems, so you can also use java.util.Collection but you may have to change your clause function within the query to add a cast function depending on the column datatype.
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