Jump to content
We've recently updated our Privacy Statement, available here ×

Problems with Custom Visualization Component on Windows


c.huettermann

Recommended Posts

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
 

Link to comment
Share on other sites

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

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.

Link to comment
Share on other sites

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-jaspersoft-studio-v56x), 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 :)

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
  • 2 weeks later...

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:binphantomjs3. Add C:binphantomjs to PATH (Environment Variables) 4. Check that it works by issuing "phantomjs --version" in cmd[/code]

for Ubuntu:

cd /usr/local/share/sudo wget http://phantomjs.googlecode.com/files/phantomjs-x.y.z-linux-x86_64.tar.bz2sudo tar jxvf phantomjs-x.y.z-linux-x86_64.tar.bz2sudo ln -s /usr/local/share/phantomjs-x.y.z-linux-x86_64/ /usr/local/share/phantomjssudo ln -s /usr/local/share/phantomjs/bin/phantomjs /usr/local/bin/phantomjs####check that it works by issuing "phantomjs --version" in terminal[/code]

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

 

Link to comment
Share on other sites

  • 7 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...