florian.weihl Posted August 10, 2021 Share Posted August 10, 2021 Hi there,I'm currently facing the issus that I cannot send my defined list parameter via REST query.The report displays only the parameter values and I call the report with this request: http://localhost:8080/jasperserver/rest_v2/reports/reports/PARAMETRERTEST.html?PARAMETER_TYPES=26117&PARAMETER_TYPES=26118The requests works fine, but the report wont display my passed list items.My list is currently not filled with any values, since it will be depentend on another input field. If this is possible, which I don't know.Can someone help me with this issue?Thanks in advance Link to comment Share on other sites More sharing options...
yama818 Posted August 10, 2021 Share Posted August 10, 2021 I am not fully understanding your question, but I would like to comment on something that has been bothering me.I was wondering why the parameter property 'Nested Type Name' is not set.I wonder if this is something that can be omitted?I hope this is helpful. Link to comment Share on other sites More sharing options...
florian.weihl Posted August 11, 2021 Author Share Posted August 11, 2021 Hi,thanks for the quick response.I set the nested type to be an integer, but that didn't work.Let me try to explain it a little bit diffrent.I defined my list list this <parameter name="PARAMETER_TYPES" class="java.util.List" nestedType="java.lang.Integer"/> It does not have any defined list items, since I want them to be dynamic (depending on the value of another parameter).If I define entries for my list, then it works like a charm and I can make the REST call without any problems.But I want the list to be able to accept any values.Best regards Link to comment Share on other sites More sharing options...
florian.weihl Posted August 12, 2021 Author Share Posted August 12, 2021 I've found this articel https://community.jaspersoft.com/questions/1113731/collections-and-rest-api-urlsBut event if I try it, like they suggest, it wont work. Link to comment Share on other sites More sharing options...
yama818 Posted August 12, 2021 Share Posted August 12, 2021 I noticed one more thing.It may be because you have not defined the values to be displayed in the input control list for the parameter 'PARAMETER_TYPES'.For example, if the following URL is accessed, I think it will not work unless '26117' and '26118' are present as values in the input control list.http://localhost:8080/jasperserver/rest_v2/reports/reports/PARAMETRERTEST.html?PARAMETER_TYPES=26117&PARAMETER_TYPES=26118[/code]Therefore, if you specify 'any value', I think all of the assumed 'any values' must appear in the list beforehand.I hope this is helpful. Link to comment Share on other sites More sharing options...
florian.weihl Posted August 13, 2021 Author Share Posted August 13, 2021 Yes, thank you! I also figured that one out yesterday evening :DBut that one keeped me thinking... Is there anyway I can change the accapted values of a list via REST? I thought I could do it over the options - service, but that one is not available for me for some reasons. Link to comment Share on other sites More sharing options...
yama818 Posted August 14, 2021 Share Posted August 14, 2021 I haven't tried it, but there seems to be a way.https://community.jaspersoft.com/documentation/tibco-jasperreports-server-rest-api-reference/v790/inputcontrols-service--> Setting Input Control ValuesI hope this is helpful. Link to comment Share on other sites More sharing options...
Solution florian.weihl Posted August 16, 2021 Author Solution Share Posted August 16, 2021 I saw that one too, but this only set's the values, in a predefined list, as selected.However I figured out how I can change the list items.Each report has, apperently, its own resources and for list parameters which are defined like in the picture below, then jasper generates invisible files for them.These files can be accessed via the following requesthttp://<<Jasper-IP>>/jasperserver/rest_v2/resources/reports/<<REPORT_NAME>>_files/<<PARAMETER_NAME>>_files/<<PARAMETER_NAME>>Within the header the parameter "Content-Type" needs to be set to "application/repository.listOfValues+json" or "application/repository.listOfValues+xml"With the PUT - method a body like this{ "label": "lov_<<PARAMETER_NAME>>", "version": 0, "type": 6, "items": [ {"label": "test3", "value": "25626"} ]}you can change the values of the list parameter :)BUT the version number must be the same as the one from the the jasperserver. Each time you change at least one list properties the jasperserver increments this version number by 1. Thank you so much for your time and help :) 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