[#3666] - IReport 3.0 can't handle left/right bracket delimiters in a $X{} list

Category:
Bug report
Priority:
High
Status:
New
Project: Severity:
Major
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:
1

This was logged on the forum on 11th March 2009 with no response to date:

I am using a Multi-select Query (check box) Input Control on Jasper Server to provide the user with an interface for selecting a list of names displayed from the database.

I have added this Input Control to a Jasper Server Report with 'always prompt' so that the end user gets to select one or more items from the total set [in this case rank names] read in from the database. The Input Control correctly displays the total set of rank names from the database for the end user as a pick list with check boxes, but the query also retrieves the corresponding rank values [in this case a list of integers separated by commas], which it passes as input to the query as a java.util.collection.

The JRXML for the report has been generated in IReport 3.0.0. When I run the report at development time and key in the input string for the rankvalue list as 2,3,4 the WHERE $X{IN,rankvalue,inputstring} ... SQL Query is properly converted and the report works correctly. When I import the JRXML code from IReport to Jasper Server and run it using the Multi-select Input Control, the report fails dismally. This is because the Jasper Server passes the collection with left and right square bracket delimiters, i.e. [2,3,4] and the $X{} machinery is unable to handle the left and right square bracket delimiters.

I have defined the input parameter to the report as java.util.List, but there does not seem to be any way to make the parameter give up the list's leading and trailing delimiters. I can remove the brackets via a $V{}, but that can't be input as a parameter into the $X{} function. Does anyone know of a work around for this or, alternatively, can we rework the $X{} functionality to recognise square bracket delimiters and strip them off before proceeding with the rest of its query generating activities?

og1's picture
og1
3
Joined: Mar 11 2009 - 3:35pm
Last seen: 12 years 6 months ago
Feedback