sadakar Posted June 12, 2014 Share Posted June 12, 2014 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 : 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 SCRIPTvisualize({ 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.SadakarBI developer Link to comment Share on other sites More sharing options...
sadakar Posted June 12, 2014 Author Share Posted June 12, 2014 Note that my server is running on 8081 and 5433 Link to comment Share on other sites More sharing options...
mgeise Posted June 12, 2014 Share Posted June 12, 2014 are you seeing any errors in the server logs? Link to comment Share on other sites More sharing options...
sadakar Posted June 12, 2014 Author Share Posted June 12, 2014 /sites/default/files/images/Screenshot(1).png Link to comment Share on other sites More sharing options...
mgeise Posted June 12, 2014 Share Posted June 12, 2014 Try using 127.0.0.1 instead of localhost Link to comment Share on other sites More sharing options...
mgeise Posted June 12, 2014 Share Posted June 12, 2014 also see: http://community.jaspersoft.com/wiki/visualizejs-troubleshooting Link to comment Share on other sites More sharing options...
sadakar Posted June 12, 2014 Author Share Posted June 12, 2014 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 . Link to comment Share on other sites More sharing options...
nesterone Posted June 12, 2014 Share Posted June 12, 2014 Hi, I see missing double quote (line 9)should be likev("#container").report() instead of v(#container").report() I hope it helps Thanks,Igor N Link to comment Share on other sites More sharing options...
sadakar Posted June 12, 2014 Author Share Posted June 12, 2014 If you see in the image code.. it's not mistaken. Link to comment Share on other sites More sharing options...
sadakar Posted June 12, 2014 Author Share Posted June 12, 2014 every thing enclosed properly.. (as not in image or shared code).. Done exactly as there in tutorial video. Link to comment Share on other sites More sharing options...
djohnson53 Posted June 12, 2014 Share Posted June 12, 2014 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 id. But the v(#container") is definitely wrong. Link to comment Share on other sites More sharing options...
sadakar Posted June 13, 2014 Author Share Posted June 13, 2014 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 ----------- ( 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. Link to comment Share on other sites More sharing options...
nesterone Posted June 13, 2014 Share Posted June 13, 2014 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 Link to comment Share on other sites More sharing options...
nesterone Posted June 13, 2014 Share Posted June 13, 2014 Yep, I would like to see more info, like errors in console Link to comment Share on other sites More sharing options...
sadakar Posted June 13, 2014 Author Share Posted June 13, 2014 Did any one get it working ? Link to comment Share on other sites More sharing options...
nesterone Posted June 16, 2014 Share Posted June 16, 2014 Hi, sadakarI 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/ Link to comment Share on other sites More sharing options...
sadakar Posted June 16, 2014 Author Share Posted June 16, 2014 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 Link to comment Share on other sites More sharing options...
sadakar Posted June 16, 2014 Author Share Posted June 16, 2014 It has worked in Chrome but not in Mozilla.. What would be probable reason for this ??? Link to comment Share on other sites More sharing options...
sadakar Posted June 17, 2014 Author Share Posted June 17, 2014 How we can do the same in plain html page ?Tried belowCreated 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 tomcatfor 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. Link to comment Share on other sites More sharing options...
nesterone Posted June 19, 2014 Share Posted June 19, 2014 IS '/VSoftBI/Reports/DigitalDashboard/BranchStatus' uri to report or to Dashboard ? Link to comment Share on other sites More sharing options...
sadakar Posted June 19, 2014 Author Share Posted June 19, 2014 It has worked.... I just needed to use the IP address instead of localhost when I call the URL in 3rd party application.. That was the location of report only.. (Dashboard reports -my folder structure was like that).. Of course, I have also tried to call a dashboard but visualize.js not for dashobards it seems rather than reports. What do you say ??? Link to comment Share on other sites More sharing options...
mheck Posted July 16, 2014 Share Posted July 16, 2014 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now