Problem with rendering the Dashboard

0

Hello

 

I just started to work with the visualize.js and experince the problem with rendering my Dashboard. The developer tool in chrome shows me the following errors

Failed to load resource:http://localhost:8081/jasperserver-pro/rest_v2/reportExecutions the server responded with a status of 400 ()

visualize.js:54 17:41:21.966 [bi/report/Report] [visualize.js:54] [ERROR] - illegal.parameter.value.error : the value "/public/Workshop/Ad_Hoc_View" of the parameter "reportURI" is invalid.

 

here is the code

<html>

<head>

<script src="http://localhost:8081/jasperserver-pro/client/visualize.js"></script>

</head>

<body>

<div id="container"></div>

<script>

visualize({
    auth: {
      name: "jasperadmin",
    password: "jasperadmin"
    }
}, function (v) {

    var report = v.report({
      resource: "/public/Workshop/Profit_Dashboard",
      container: "#container",
      });

});

</script>
 
</body>

</html>

 

 

vadim.kalyshkin's picture
Joined: Nov 21 2018 - 8:47am
Last seen: 1 month 3 weeks ago

1 Answer:

0

You are using report rendering function for rendering dashboards - That's the problem. You should be using v.dashboard. For example:

visualize({
    auth: {
        name: "jasperadmin",
        password: "jasperadmin",
    }
}, function (v) {
    var dashboard = v.dashboard({
        resource: "/public/Workshop/Profit_Dashboard",
        container: "#container"
    });
});

prusyn's picture
255
Joined: Feb 22 2018 - 3:49am
Last seen: 1 hour 9 min ago
Feedback
randomness