Report Parameter as List

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/PARAMETRERTES...
The 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
 

florian.weihl's picture
Joined: Aug 9 2021 - 11:44pm
Last seen: 1 year 9 months ago

7 Answers:

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 request
http://<<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 :)

Attachments: 
AttachmentSize
Image icon listofvalues.png12.38 KB
florian.weihl's picture
Joined: Aug 9 2021 - 11:44pm
Last seen: 1 year 9 months ago

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.

 

yama818's picture
6689
Joined: Aug 17 2018 - 3:48pm
Last seen: 1 month 2 weeks ago

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

 

florian.weihl's picture
Joined: Aug 9 2021 - 11:44pm
Last seen: 1 year 9 months ago

I've found this articel https://community.jaspersoft.com/questions/1113731/collections-and-rest-...

But event if I try it, like they suggest, it wont work.

florian.weihl's picture
Joined: Aug 9 2021 - 11:44pm
Last seen: 1 year 9 months ago

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


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.

yama818's picture
6689
Joined: Aug 17 2018 - 3:48pm
Last seen: 1 month 2 weeks ago

Yes, thank you! I also figured that one out yesterday evening :D

But 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.

 

florian.weihl's picture
Joined: Aug 9 2021 - 11:44pm
Last seen: 1 year 9 months ago

I haven't tried it, but there seems to be a way.
https://community.jaspersoft.com/documentation/tibco-jasperreports-serve...
--> Setting Input Control Values

I hope this is helpful.

 

yama818's picture
6689
Joined: Aug 17 2018 - 3:48pm
Last seen: 1 month 2 weeks ago
Feedback