akthar.itzme Posted January 29, 2016 Share Posted January 29, 2016 Hi ,I am facing problem with Custom Visualization Component while exporting it in pdf format. Html format is working fine but pdf/java is not working.I have checked the phantomjs path, It is set correctly and tested with command promp also.I have also changed phantomjs version from 2.0 to 1.9.2. Still the problem exist.Due to this issue i am not able to export my CVC reports. Kindly help regarding this. It is important. !!! Link to comment Share on other sites More sharing options...
akthar.itzme Posted January 29, 2016 Author Share Posted January 29, 2016 I request Jasper Team to help quickly. Link to comment Share on other sites More sharing options...
hozawa Posted January 29, 2016 Share Posted January 29, 2016 It's working OK for me. Of course, pdf isn't interactive but I do get static images.Check if there is any error in the Tomcat console and fix it if there is. Link to comment Share on other sites More sharing options...
akthar.itzme Posted February 1, 2016 Author Share Posted February 1, 2016 Hi,Thanks for your answer. I checked my server log i am getting the following error:ERROR CVElementPhantomJSImageProvider,pool-15-thread-2:91 - Generating image for Custom Visualization element 1334138075 failed.net.sf.jasperreports.engine.JRRuntimeException: Error while executing the javascript file to generate the SVG image: External process did not end properly; exit value: 1; process output:--- Running highcharts.src.js from GitHub, branch/commit/tag "master" ---SCRIPT_SUCCESS Now after some times i get empty PDF reports. HTML Output is working great always. Kindly guide me in solving this. Urgent !!! Link to comment Share on other sites More sharing options...
akthar.itzme Posted February 1, 2016 Author Share Posted February 1, 2016 My Javascript code is as follow :define(['jquery_hc','hchart'], function ($, Highcharts) { function getMonoChromeColors() { var colors = [],base = Highcharts.getOptions().colors[0],i; for (i = 0; i < 10; i += 1) {// Start out with a darkened base color (negative brighten), and end// up with a much brighter colorcolors.push(Highcharts.Color(base).brighten((i - 3) / 7).get());}return colors;} return function (instanceData) { /*** Drop-in compatibility fix for semi-transparent strokes and fills for old WebKit * browsers as well as Batik export servers. The fix splits rgba fill colors into * solid colors for fills, and a separate fill-opacity attribute.*/Highcharts.SVGElement.prototype.fillSetter = Highcharts.SVGElement.prototype.strokeSetter = function (value, key, element) { var colorObject; if (typeof value === 'string') { if (value.indexOf('rgba') === 0) { // Split it up colorObject = Highcharts.Color(value); element.setAttribute(key + '-opacity', colorObject.get('a')); element.setAttribute(key, colorObject.get('rgb')); } else { element.removeAttribute(key + '-opacity'); element.setAttribute(key, value); } } else { this.colorGradient(value, key, element); }}; var data = [{"name" : "apple", "y" : 200}, {"name" : "Orange", "y" : 100}]; var series0 = instanceData.series[0]; // I have used dummy data already So, not going to use series0 data. var config = { chart: { renderTo: instanceData.id, backgroundColor: null, borderWidth: 0, margin: [2, 0, 2, 0], type: 'pie', width: instanceData.width, height: instanceData.height, style: { overflow: 'visible' }, skipClone: true }, tooltip: { backgroundColor: null, borderWidth: 0, shadow: false, useHTML: true, hideDelay: 0, shared: true, padding: 0, pointFormat: '<b>{point.y} ({point.percentage:.1f}%)</b>' }, plotOptions: { pie: { allowPointSelect: true, cursor: 'pointer', dataLabels: { enabled: true, format: '<b>{point.name}</b>: {point.percentage:.1f} %', style: { color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' } }, colors: getMonoChromeColors() } }, series: [{ name: 'Brands', data: data }] }; new Highcharts.Chart(config);};}); Link to comment Share on other sites More sharing options...
diksha.mene Posted April 6, 2021 Share Posted April 6, 2021 Hi, I am getting same error.. PDF export is not working even with version 1.9.2 . Link to comment Share on other sites More sharing options...
ktalarico Posted February 7 Share Posted February 7 Did anyone find a resolution to this? The issue is with jquery in the javascript. My CVC uses jquery also. It seems as if the exporter does not know about jquery. With additional log settings - this error is generated: ReferenceError: jQuery is not defined\n at file:///tmp/jr_res_16848789916710125977_clusteredmap.min.js:63:9\n 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