Visualize js in plain HTML

1

I want to render visualize js inside plain HTML, getting below error. Kindly help me to resolve the same.

Uncaught SyntaxError: Invalid regular expression: /[À-ß][€-¿]|[à -ï][€-¿]{2}|[ð-÷][€-¿]{3}/: Range out of order in character class
visualize.html:11 Uncaught ReferenceError: visualize is not defined
 
My Code
 
<html>
<head>
 
</head>
<body>
<div id="reportContainer">Loading..</div>
<script>
 
 
visualize({
    auth: {
        name: "jasperadmin",
        password: "jasperadmin"
        
    }
}, function (v) {
    v.report({
        resource: "/public/chart",
        container: "#reportContainer",
        defaultJiveUi: { enabled: false },
        error: function (err) {
            alert(err.message);
        }
    });
});
 
</script>
 
</body>
</html>

 

kalyan.kkannan's picture
Joined: Oct 6 2014 - 10:24am
Last seen: 4 years 2 months ago

This SyntaxError is exactly same what I've seen as well.

 

jleppa - 4 years 3 months ago

2 Answers:

0

Seems like visualize.js script file is not being loaded. First, you are using Commercial version of JasperReport Server aren't you? Visualize.js is not supported in community version.

Try if you can access it by just entering the following from your web browser.

http://127.0.0.1:8080/jasperserver-pro/client/visualize.js

Try deleting the following:

server: "http://127.0.0.1:8080/jasperserver-pro",

hozawa's picture
40895
Joined: Apr 24 2010 - 4:31pm
Last seen: 12 hours 53 min ago
0

Please refer to the following:

<html>

<head>

<script src="http://127.0.0.1:8080/jasperserver-pro/client/visualize.js?_opt=false"></script>

</head>

<body>

<div id="reportContainer">Loading..</div>

 

<script>

visualize({

//server: "http://127.0.0.1:8080/jasperserver-pro",

auth: {

name: "jasperadmin",

password: "jasperadmin",

organization: "organization_1" }

 

}, function (v) {

v("#reportContainer").report({

resource: "/public/Samples/Reports/01._Geographic_Results_by_Segment_Report", defaultJiveUi: { enabled: false },

error: handleError });

 

function handleError(err){

alert(err.message);

} });

</script>

</body>

</html>

============================

jsfiddle: http://jsfiddle.net/zwr2ohtz/

mcota_1's picture
24
Joined: Aug 8 2014 - 12:52pm
Last seen: 3 years 1 month ago

On browser when hitting http://127.0.0.1:8080/jasperserver-pro/client/visualize.js, i am able to see the visualize.js getting downloaded.
I simply used the above code but getting the below error.

Uncaught TypeError: Cannot read property '2' of nullvisualize.js?_opt=false:9780 getLocationvisualize.js?_opt=false:10095 prepareTransportStackvisualize.js?_opt=false:10823 easyXDM.Rpcvisualize.js?_opt=false:12362 makeRpcvisualize.js?_opt=false:12515 (anonymous function)visualize.js?_opt=false:16059 (anonymous function)visualize.js?_opt=false:15902 jQuery.Callbacks.firevisualize.js?_opt=false:15948 jQuery.Callbacks.self.addvisualize.js?_opt=false:16058 (anonymous function)visualize.js?_opt=false:13187 jQuery.extend.eachvisualize.js?_opt=false:16055 (anonymous function)visualize.js?_opt=false:16115 jQuery.extend.Deferredvisualize.js?_opt=false:16054 jQuery.extend.Deferred.promise.thenvisualize.js?_opt=false:12514 Rootvisualize.js?_opt=false:12750 (anonymous function)visualize.js?_opt=false:1699 context.execCbvisualize.js?_opt=false:915 Module.checkvisualize.js?_opt=false:1192 Module.enablevisualize.js?_opt=false:823 Module.initvisualize.js?_opt=false:1465 (anonymous function)

kalyan.kkannan - 4 years 3 months ago

http://jsfiddle.net/zwr2ohtz/3/

What JasperReport Server version are you using?

Thank you

mcota_1 - 4 years 3 months ago

Looks like that parameter _opt=false is workaround for me. My version is Pro 6.0.1 (30day trial).

jleppa - 4 years 3 months ago
Feedback
randomness