Jasper report (rest_v2/reportExecutions) not recognized collection parameters

I have main report with parameter called list_departments:

<parameter name="list_departments" class="java.util.Collection" nestedType="java.lang.String" evaluationTime="Early">
    <defaultValueExpression><![CDATA[new ArrayList(Arrays.asList(new String[]{}))]]></defaultValueExpression>
</parameter>

Generating a report through the jasper studio works fine.

But when deploy it on server, i have problem with rest /rest_v2/reportExecutions (code written in python - flask):

payload = {
        "reportUnitUri": "my_name",
        "async": True,
        "outputFormat": "pdf",
        "interactive": True,
        "ignorePagination": False,
        "parameters": {
            "reportParameter": [{"name": "list_departments", "value": ["val1","val2"]},...]
        }
    }

All other parameters are well processed and displayed on the report except this one, which is displayed as an empty list, although something has been sent (val1, val2).

Cannot find out where the problem is occurring, please help

tomo.pinjuh's picture
Joined: Apr 28 2020 - 1:31pm
Last seen: 7 months 1 week ago

1 Answer:

Try java.util.List instead of java.util.Collection and don't use nested type.

Mariano

mlopez_1's picture
6227
Joined: Oct 21 2013 - 8:08am
Last seen: 2 hours 6 min ago

Can I use non-predefined values on the jasper server for that field as the list parameters?

tomo.pinjuh - 3 years 5 months ago

Yes you can. There will be an empty list, not null list.

Mariano

mlopez_1 - 3 years 5 months ago

Ok, but i want when i pass the list to print it in the report, however it is always blank, and this is a problem

tomo.pinjuh - 3 years 5 months ago
show 1 more...

Well, make sure that you pass an input control with the same ID than report unit's parameter and make sure that input control is multi select an parameter is java.util.List.

I used much of this type and works well.

Mariano

mlopez_1 - 3 years 5 months ago
Feedback