I'm using JasperReports Server v4.5.
We are having difficulties with scheduling a report by using REST API.
We are able to schedule a report that only accepts string parameters however the problem begins with a report that has a java.util.Collection type parameter. We tried everything but couldn't find the correct type for java.util.Collection.
Right now this 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 couldn't get this working:
<parameters>
<name>array_parameter</name>
<value type=? >[1, 2, 3]</value>
</parameters>
When I looked into the code, I can see that JasperReports Server WS accepts arrays, however there is no documented way to send the arrays or array types.
What is the correct way to solve this issue?
Give this a 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:
Some have suggested removing the entry
tags. If the above does not work, try removing the entry
tags.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With