muhammad.rehman Posted August 4, 2014 Share Posted August 4, 2014 When I incorporating tablular / crosstab reprort, it is working fine but when I change the report with HighCharts, it gives me error "highchartsOptions is not defined" Link to comment Share on other sites More sharing options...
muhammad.rehman Posted August 4, 2014 Author Share Posted August 4, 2014 When I incorporating tablular / crosstab reprort, it is working fine but when I change the report with HighCharts, it gives me error "Uncaught ReferenceError: highchartsOptions is not defined"Please find my script below. <script type="text/javascript" src="http://127.0.0.1/jasperserver-pro/client/visualize.js"></script> <button id="button" class="hide">Refresh</button><button id="export" class="hide">Export</button><button id="reload" class="hide">Reload</button> <div id="container"></div> $(function () { visualize({ auth: { name: "jasperadmin", password: "jasperadmin", organization: "organization_1" } }, function (v) { var report = v.report({ resource: "/public/OccupancyDrillDown", container: "#container", error: function (err) { alert("Visualize JS error: " + err.message); } }); function buildControl(name, options) { function buildOptions(options) { var template = "<option>{value}</option>"; return options.reduce(function (memo, option) { return memo + template.replace("{value}", option); }, "") } console.log(options); if (!options.length) { console.log(options); } var template = "<label>{label}</label><select>{options}</select><br>",content = template.replace("{label}", name).replace("{options}", buildOptions(options)); $("#container").append($(content)); } $("#export").click(function () { //report.run(exportToPdf); report.export({ outputFormat: "pdf" }).done(function (link) { window.open(link.href); // open new window to download report }).fail(function (err) { alert(err.message); }); }); function exportToPdf() { report.export({ outputFormat: "pdf" }).done(function (link) { window.open(link.href); // open new window to download report }).fail(function (err) { alert(err.message); }); } $("#button").click(function () { report.refresh().done(function () { console.log("Report Refreshed!"); }).fail(function () { alert("Report Refresh Failed!"); }); }); $("#reload").click(function () { report.refresh().done(function () { console.log("Report Refreshed!"); }).fail(function () { alert("Report Refresh Failed!"); }); }); $("#reload").show(); $("#button").show(); $("#export").show(); }); }); Link to comment Share on other sites More sharing options...
marianol Posted August 4, 2014 Share Posted August 4, 2014 Looks like for some reason is not Visualize is not able to load the supporting libraries. Can you replicate this on a fiddle? Also I have seen some issues with Visualize and hostname (i.e. localhost vs 127.0.0.1) can you call visualize using our IP address or DNS name instead of the local loopback? Link to comment Share on other sites More sharing options...
muhammad.rehman Posted August 5, 2014 Author Share Posted August 5, 2014 It solved now. I manually read the jrxml file and delete the hyperlinke code. After that it started working.Thanks for your support. 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