Jump to content

Recommended Posts

Posted

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?

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...