Jump to content
Changes to the Jaspersoft community edition download ×

Visualize.js - Send parameters


matheusluz39

Recommended Posts

Good morning,

 

I have this parameters.

<parameter name="paramString" class="java.lang.String"/>
<parameter name="paramArray" class="java.util.ArrayList"/>[/code]
Using visualiza.js. How can I send parameters to paramArray?

visualize(function ( v ){
v("#container").report({
resource: "/public/MyProject/Reports/teste",
params: {
"paramString": ["Title! Hello world"],
"paramArray": [???]
}
});
});[/code]
 

 

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: com.jaspersoft.jasperserver.jaxrs.report.ReportExecutionRequest["parameters"]->com.jaspersoft.jasperserver.dto.reports.ReportParameters["reportParameter"]->com.jaspersoft.jasperserver.dto.reports.ReportParameter["value"])

 

What's wrong?

 

Thank you...

Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

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 ,

Link to comment
Share on other sites

  • 5 months later...

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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...