Problems with Custom Visualization Component on Windows

0

Thank you for the documentation of creating and using Custom Visualization Component for JSS 6.x (http://community.jaspersoft.com/wiki/custom-visualization-component-v60x).

Unfortunately I am not able to preview the components with other previewers than HTML. Probably PhantomJS causes the problems.

Here is a brief shortcut of my configuration (and environment):

1.) OS: Windows 7

2.) JSS 6.0.1 final

3.) PhantomJS 1.9.8 for windows

4.) Properties:

com.jaspersoft.jasperreports.components.customvisualization.require.js = C:/bin/TIBCO/Jaspersoft Studio-6.0.1.final/configuration/org.eclipse.osgi/bundles/11/1/.cp/resources/scripts/require-2.1.6.src.js

com.jaspersoft.jasperreports.components.customvisualization.phantomjs.executable.path = C:/bin/phantomjs-1.9.8-windows/phantomjs.exe

5.) I created a new CVC with the help of the Wizard (template Circle Sample based on D3.js library)

6.) Build component with build.js

7.) Preview of report d3_Circle_sample.jrxml in Java-Previewer throws the following Exception:

net.sf.jasperreports.engine.JRRuntimeException: 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:
svgs...1
Source is <svg id="element1988531457svg" width="555" height="376" version="1.1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink"><style type="text/css"><![CDATA[
#element1988531457svg circle { fill: #f000ff; }]]></style><circle cx="277.5" cy="188" r="178"></circle></svg>
SCRIPT_SUCCESS



    at com.jaspersoft.jasperreports.customvisualization.export.CVElementPhantomJSImageProvider.createSvgImage(CVElementPhantomJSImageProvider.java:106)

    at com.jaspersoft.jasperreports.customvisualization.export.CVElementImageProvider.createRenderable(CVElementImageProvider.java:159)

    at com.jaspersoft.jasperreports.customvisualization.export.CVElementImageProvider.getImage(CVElementImageProvider.java:135)

    at com.jaspersoft.jasperreports.customvisualization.export.CVElementPdfHandler.exportElement(CVElementPdfHandler.java:57)

    at net.sf.jasperreports.engine.export.JRPdfExporter.exportGenericElement(JRPdfExporter.java:2836)

    at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:993)

    at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:944)

    at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:816)

    at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:519)

    at com.jaspersoft.studio.editor.preview.actions.export.AExportAction.exportWithProgress(AExportAction.java:174)

    at com.jaspersoft.studio.editor.preview.actions.export.AExportAction.doExport(AExportAction.java:201)

    at com.jaspersoft.studio.editor.preview.actions.export.AExportAction$2.run(AExportAction.java:149)

    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Caused by: 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:
svgs...1
Source is <svg id="element1988531457svg" width="555" height="376" version="1.1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink"><style type="text/css"><![CDATA[
#element1988531457svg circle { fill: #f000ff; }]]></style><circle cx="277.5" cy="188" r="178"></circle></svg>
SCRIPT_SUCCESS



    at com.jaspersoft.jasperreports.customvisualization.export.CVElementPhantomJSImageProvider.getImageData(CVElementPhantomJSImageProvider.java:241)

    at com.jaspersoft.jasperreports.customvisualization.export.CVElementPhantomJSImageProvider.createSvgImage(CVElementPhantomJSImageProvider.java:86)

    ... 12 more
 

c.huettermann's picture
Joined: Jan 27 2015 - 1:43pm
Last seen: 1 year 4 months ago

5 Answers:

0

Hi.

I had a similar problem earlier today. I fixed it by selecting in the "design" tab of the jrxml file, then top-right, click "settings > preview format", then select "html"

Hopefully that will work for you.

Have you found any resource on custom visualization components? Because I'm trying to create my own from scratch and I can't find much information. 

And Jaspersoft studio isn't very helpful.

Thanks.

quikman5988's picture
Joined: Jan 29 2015 - 8:45am
Last seen: 2 years 7 months ago

HTML Preview works as I mentioned above, but this is not sufficient for me, because PDF generation must work, too (and it does not work :( ).

I didn't find helpful resources on cvc for version 6.x, but I hope the wiki-documentation will give useful hints (it's still in progress).
I found some more information here (http://community.jaspersoft.com/wiki/custom-visualization-component-jasp...), but I don't know if it's still up to date (Version 5.6).
The best resource seems to be the source code of the examples :).

Let's hope for further help of the community :)

c.huettermann - 2 years 7 months ago

The wiki for version 6 is available now. (http://community.jaspersoft.com/wiki/custom-visualization-component-v60x)
Though it is still in progress, it is helpful, and better than the previous version wiki.

mustafa_2 - 2 years 7 months ago

Still the problem exist. Tried all said answers. Kindly help as soon as possible. Jasper guys help us.

akthar.itzme - 1 year 7 months ago
0

check your phantomjs REALLY WORK,,,

when I use another version of phantomjs, the java preview works

chenyang.feng.cn's picture
Joined: Mar 16 2015 - 3:53pm
Last seen: 2 years 3 months ago
0

I had a similar problem and solved it by using older version of phantomjs - 1.9.2

manders_1's picture
Joined: Aug 16 2013 - 2:11pm
Last seen: 9 months 4 weeks ago
0

Hi i am facing same problem even i changed phantomjs 2.0 to 1.9

plese gie me any solution for this

 

 

naga

 

naga6471's picture
Joined: Sep 19 2013 - 5:35am
Last seen: 2 years 3 months ago
0

try to define your phantomjs in your environment system path, so you don't need to define in properties anymore.

for windows:

1. Download phantomjs-x.y.z-windows.zip AND EXTRACT it.
2. Move the contents OF phantomjs-x.y.z-windows TO C:\bin\phantomjs
3. ADD C:\bin\phantomjs TO PATH (Environment VARIABLES) 
4. CHECK that it works BY issuing "phantomjs --version" IN cmd

for Ubuntu:

cd /usr/LOCAL/share/
sudo wget http://phantomjs.googlecode.com/files/phantomjs-x.y.z-linux-x86_64.tar.bz2
sudo tar jxvf phantomjs-x.y.z-linux-x86_64.tar.bz2
sudo ln -s /usr/LOCAL/share/phantomjs-x.y.z-linux-x86_64/ /usr/LOCAL/share/phantomjs
sudo ln -s /usr/LOCAL/share/phantomjs/bin/phantomjs /usr/LOCAL/bin/phantomjs
 
####
CHECK that it works BY issuing "phantomjs --version" IN terminal

source : http://attester.ariatemplates.com/usage/phantom.html

newbie wan's picture
Joined: Nov 12 2014 - 10:20pm
Last seen: 6 months 2 weeks ago
Feedback
randomness