In JSFiddle writting below code to test but unable to produce the ouptu.
Installed jasper server pro 5.6 in Cent OS 6.5 and the server is UP with jasperadmin/jasperadmin (in another case with superuser/superuser).
I'm following this tutorial : https://www.youtube.com/watch?v=xGbcQb1N-gU&feature=youtu.be
HTML:
<!-- Provide URL to Visualize.js -->
<script type="text/javascript" scr="http://localhost:8081/jasperserver-pro/client/visualize.js">
</script>
<!-- Provide container to render your visualization -->
<div id="container"></div>
JAVA SCRIPT
visualize({
auth: {
name:"jasperadmin",
password:"jasperadmin",
organization:"organization_1"
}
},
function(v){
//render report from provided resource
v(#container").report({
resource:"/public/Samples/Reports/01._Geographic_Results_by_Segment_Report",
error: handleError
});
//show error
function handleError(err){
alert(err.message);
}
});
Could you please tell me where I am going wrong with this new conept ?
Thanks in Advance.
Sadakar
BI developer
7 Answers:
Try using 127.0.0.1 instead of localhost
jsfiddle is down now(Jun 12 1:12 P.M IST) .. will test with an hmtl file..
I have written the same code in HTML file and opened it.. but nothing came.. When opened it has taken file:///home/a1551/Desktop/visualize.html as URL address and on the webpage all the visualize code is coming up..
So, how can I call html page after writing the visulize code in html file ?
Thank you in Advance .
We are using special cross-domain transfer for Viz, so it's better to work with viz.html not as with local file but as html serving from a webserver
Hi,
I see missing double quote (line 9)
should be like
v("#container").report() instead of v(#container").report()
I hope it helps
Thanks,
Igor N
If you see in the image code.. it's not mistaken.
every thing enclosed properly.. (as not in image or shared code).. Done exactly as there in tutorial video.
I would think that either the v(#container") would either be a syntax error, or it would be looking for a label, #container" , that wouldn't match the <div> id. But the v(#container") is definitely wrong.
Hi Japser, Still I am struck with it.
Need your help on authenticating.
Now, just trying to authenticate from your tutorial http://jsfiddle.net/marianol/CK3WW/ in jsfiddle.net and nothing I'm seeing output box when I run the code.
My Jasper installed in Cent OS 6.5 in external folder(/home/a1551/jasperreports-server-5.6 i.e, not under opt folder) which is working fine with 8081/5433 port numbers in all the browsers.
I had already 5.5 pro under opt which is shut down in my machine.
I have tried below from the video tutorial
HTML
-----------
<script type='text/javascipt' src="http://127.0.0.1:8081/jasperserver-pro/client/visualize.js?logLevel=debu...
( I have also tried giving my ip address in a test and in another test as localhost in place of 127.0.0.1 but all the 3 tests didn't give me any result in JSFiddle).
JavaScript
------------------
visualize({
auth: {
name: "jasperadmin",
password: "jasperadmin",
organization:"organization_1",
//timezone: "Europe/Helsinki"
}
}, function (v) {
//'v' it's a client to JRS instance initialized above
// with a session established for joeuser from organization_1
alert("Welcome! JRS Authentication successful.");
}, function (err) {
alert("Auth error! Server said: " + err.message);
});
Any inputs will be appreciated
Thank you.
Hi, sadakar
I have made it works and it seems like your sample has mistype in HTML markup like:
<script "scr" > instead of <script "src">
Just try my sample but with your URL to vizualize
http://jsfiddle.net/NesterOne/2Km35/3/
First of all thank you for the support..
I have opened your link and changed port number from 8080 to 8081 where my jasper is running .. While opening the link I've observed there it is showing "Reference Error: visualize is not defined"...
So is it the problem of Mozilla browser ? Version is : 29.0.1.. Find the same in the image..
Thank you in Advance
How we can do the same in plain html page ?
Tried below
Created a folder "test" and inside it "visualize.html" page and the code for html page is
<!-- Provide URL to Visualize.js -->
<script type="text/javascript" src="http://localhost:8081/jasperserver-pro/client/visualize.js">
visualize({
auth: {
name: "superuser",
password: "superuser"
// organization: "organization_1"
}
}, function (v) {
//render report from provided resource
v("#container").report({
/*
resource:"/VSoftBI/Reports/DigitalDashboard/BranchStatus",
params:{"Date":["01/03/2014"],"instId":[312]},
*/
resource: "/public/Samples/Reports/01._Geographic_Results_by_Segment_Report",
error: handleError
});
//show error
function handleError(err) {
alert(err.message);
}
});
</script>
<!-- Provide container to render your visualization -->
<div id="container" style="width:100%;height:500px;background-color:#CCCCCC">Loading</div>
after that placed it in webapps folder of tomcat
for eg : /home/sadakar/jasperreports-server-5.6/apache-tomcat/webapps/test (under test the html is kept)
calling the file in URL as http://localhost:8081/test/visualize.html which has not rendered the report (but the styles for the div tag applied).
What is the correct way of writting visualize code in plain html page ?
Dear jasper , need your assistance on this ..
Thank you.
IS '/VSoftBI/Reports/DigitalDashboard/BranchStatus' uri to report or to Dashboard ?
Hi Sadakar,
Glad you found your rendering problem, and please pardon this late reply. You are correct, in JRS 5.6, Visualize can only render reports, not dashboards. Visualize will continue to improve and expand, of course.
In the meantime, you can of course instantiate multiple reports within one web page, by rendering reports into different containers.
Note that my server is running on 8081 and 5433
are you seeing any errors in the server logs?
Yep, I would like to see more info, like errors in console