Visualize.js - Send parameters

Good morning,
I have this parameters.
<parameter name="paramString" class="java.lang.String"/>
<parameter name="paramArray" class="java.util.ArrayList"/>
Using visualiza.js. How can I send parameters to paramArray?
visualize(function ( v ){
        resource: "/public/MyProject/Reports/teste",
        params: {
             "paramString": ["Title! Hello world"],
             "paramArray": [???]
When I tried put "paramArray": [ [1,2,3] ]
Return this error:
09:56:11.468 [bi/report/Report] [visualize.js:49] [ERROR] - illegal.parameter.value.error : Can not deserialize instance of java.util.ArrayList out of END_OBJECT token
at [Source: org.apache.catalina.connector.CoyoteInputStream@193a86fe; line: 1, column: 489] (through reference chain:["parameters"]->com.jaspersoft.jasperserver.dto.reports.ReportParameters["reportParameter"]->com.jaspersoft.jasperserver.dto.reports.ReportParameter["value"])
What's wrong?
Thank you...
matheusluz39's picture
Joined: Aug 11 2015 - 7:00am
Last seen: 6 years 8 months ago

Have you tried the following format? It's essentially an array within the params array.

"paramArray": {}

drupal7_anonymous - 7 years 5 months ago

Yes, I tryed.
When I put: 

"paramArray": {1} >>> Uncaught SyntaxError: Unexpected token }

"paramArray": {1, 2>>> Uncaught SyntaxError: Unexpected token ,

"paramArray": [{1}] >>> Uncaught SyntaxError: Unexpected token }

"paramArray": [{1, 2}] >>> Uncaught SyntaxError: Unexpected token ,

matheusluz39 - 7 years 5 months ago

Visualize.js parameters must be strings. So in your case it would be

"paramArray" : ['1','2','3']

The above example will send the parameter to the server properly. However, i'm not sure that you can have a parameter with type array list. I have never been able to run a report like that before.

tyson.decker - 6 years 11 months ago

0 Answers:

No answers yet