How to schedule a report with a collection type parameter using the REST API on a JasperReports server?

I am using JasperReports Server v4.5.

We are having difficulty planning a report using the REST API.

We can schedule a report that accepts only string parameters, but the problem starts with a report with a parameter of type java.util.Collection. We all tried, but could not find the correct type for java.util.Collection.

Now it works:

<parameters>
    <name>string_input</name>
    <value xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        test
    </value>
</parameters>

But we could not get this to work:

<parameters>
    <name>array_parameter</name>
    <value type=? >[1, 2, 3]</value>
</parameters>

When I looked at the code, I see that JasperReports Server WS accepts arrays, however there is no documented way to send arrays or array types.

What is the correct way to solve this problem?

+5
source share
1 answer

Try:

<parameters>
    <entry>
        <key>param_name</key>
        <value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="collection">
            <item xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">1</item>
            <item xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">2</item>
        </value>
    </entry>
</parameters>

Update:

entry. , entry.

+1

All Articles