Visualize.js multiple reports not displaying in Chrome

0

Multiple reports (or charts) are displaying OK in Safari, Firefox, but not in Chrome.

Sample script (below) returns an "unexpected.error" from within visualize.js when run on Chrome for the first report, but displays the second report correctly. It works perfectly on Safari and Firefox and displays both reports.

Please do not suggest using differnt format script to produce multiple reports, as this format using multiple is required (as it is simultating our need for multiple discrete portlets that may be defined for a Liferay deployment).

<script type='text/javascript'>
    window.onload=function() {
        visualize.config({
            auth: {
                name: "jasperadmin",
                password: "jasperadmin"
            }
        });
        visualize(function (v) {
            v("#container1").report({
                resource: "/public/Samples/Reports/06g.ProfitDetailReport",
                error: function (err) {
                    alert(err.message);
                }
            });
        });
        visualize(function (v) {
            v("#container2").report({
                resource: "/public/Samples/Reports/State_Performance",
                error: function (err) {
                    alert(err.message);
                }
            });
        });
    }
</script>
<script src="whetever..../jasperserver-pro/client/visualize.js?_opt=true"></script>
<div id="container1"></div>
<div id="container2"></div>

 

  

paroney's picture
Joined: Sep 4 2013 - 4:11pm
Last seen: 2 hours 23 min ago

Further Info -


It can also crash in Firefox as well.  If you artificially slow down your connections it fails.   

It appears to be the token that is the issue.  The first iteration executes which loads a token, and then the second iteration overwrites that token, and so on.  The token seems to be stored as a static / global variable, and so when the next request is made it uses the wrong token and fails.

paroney - 5 days 3 min ago

0 Answers:

No answers yet
Feedback
randomness