philippw Posted October 22, 2018 Share Posted October 22, 2018 Hello everyone,we are currently trying to test some functions within the rest_v2 API.We are using Postman (desktop application) or directly via url input in browser.Therefore we created a small sample report with a collection type parameter P_List and a field to display the content of the parameter. When we try to pass some values to the report:http://localhost:8080/jasperserver/rest_v2/reports/reports/Test/TestCollection.html?P_List=ABC&P_List=DEFthe result field is always empty.In Jasperstudio it works fine.Help is very much appreciated!Kind regards,Philipp Link to comment Share on other sites More sharing options...
philippw Posted October 23, 2018 Author Share Posted October 23, 2018 Answering my own question.We found out that we need an input control (multi-select query based input control) linked to the report in order to let the collection type parameter use the values that we pass via URL.Example url: http://localhost:8080/jasperserver/rest_v2/reports/reports/Test/TestCollection.html?P_List=123&P_List=456So what we needed was to add an input control to our TestCollection-Report with the following query:SELECT myNumber FROM myTable[/code]As a result the collection type parameter can use the predefined values and use them later on in an IN-Clause in the main query in our report:SELECT *FROM myTableWHERE$X{IN, myTable.columnname1, P_List}AND myTable.columnname2 = $P{pAnotherParameter}[/code]For me that feels redundat, as we need to query the table two times, which works, but since there are many records in this table, it still needs some time to execute the query just for the list of possible values in the input control.Does anyone have had this issue before? How did you work around this?Kind regards,Philipp 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