-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom visualization module not recognized even though its jar is in java path #189
Comments
Can you put these lines somewhere in your code and post here the output? Feel free to use any logging framework instead of
|
Thanks for your help Dadza:
Additionally, since I posted the issue on github I found a jasperReports library user manual (https://community.jaspersoft.com/sites/default/files/docs/jasperreports-ultimate-guide-3v2_0.pdf) which seems a bit outdated but provides a guide on using CVC from java (page 285). I was going to try following it just in case it's instructions for using extensions can still be used in newer jasperReports versions, even though it is quite probable that many things have changed since 2011 |
I get it that you have something in your project that creates an uber jar from all the dependencies. When you do that, you need to take specific care of jasperreports_extension.properties jar resources, which are used by JasperReports to load extensions. See a solution at https://stackoverflow.com/a/35025718 |
Thanks, now it detects the extension. I'm going to document it on the community wiki, so future users don't open a similar issue to this one if they need a fat jar 3514 [main] ERROR net.sf.jasperreports.customvisualization.export.CVElementImageProvider - Generating image for Custom Visualization element element77923161343435128113206065653047908829 failed. |
The recommended property to set for PhantomJS is net.sf.jasperreports.phantomjs.executable.path Also see net.sf.jasperreports.chrome.enabled and net.sf.jasperreports.chrome.executable.path, you can use Chromium/Chrome instead of PhantomJS (which is no longer being developed/maintained). |
Thanks again! As soon as I solve some problems related to UTF-8 encoding (� is being shown in the exported report instead of €) I'll update the wiki with a complete tutorial on using both, Chrome and PhantomJS |
That might be a bug because this line doesn't explicitly encode to UTF-8. Therefore if the default character encoding of the JVM is not UTF-8, the data can get corrupted. Can you test if starting your application with -Dfile.encoding=UTF-8 makes a difference? |
Yes, that solved it. A workaround can be found here: https://stackoverflow.com/a/14987992/15974273 , which consists in adding the following lines at the start of the main function:
On the other hand, I'm having yet another problem, as the text shown in the CVC component needs to be shown aligned with the top of the viewport, but the hanging dominant-baseline and alignment-baseline attributes get ignored. It seems that, sometimes, it might be solved by changing the display attribute of the svg to block (https://stackoverflow.com/q/21099192/15974273), yet it does not work in this case. However, they work when the report is exported to html and opened with the same chromium executable that I have bundled with the application Edit 20/5/2021 20:46: |
Log an issue for the UTF-8 problem, we need to fix the code to properly create the HTML no matter the default charset. |
When using a report template that contains a Custom Visualization Component from a custom Java application based on JasperReports Library, Jasper raises an exception due to an unknown entity even though the CVC jar has been added to java path (see the attached POM). According to the wiki (https://community.jaspersoft.com/wiki/custom-visualization-component-v60x), this module just requires specifying the path to PhantomJs to be able to use CVC components in JasperReports Server or JasperReports Studio and the JasperReports Library wiki does not contain any additional infomation about its usage (https://community.jaspersoft.com/wiki/jasperreports-library-reference-materials). Therefore, I initially assumed that it did not require any additional configuration
Nevertheless, as the Exception is still being raised, it seems that some undocumented configuration is required to enable the module. I attach below both, the Error and the POM of the project.
I tried asking before in the Answers section of your community website, but it seems to have little activity (https://community.jaspersoft.com/questions/1183536/it-possible-use-custom-visualization-components-jaspersoft-library)
Thanks in advanced
Raised exception:
POM dependencies section (JasperReports Library version 6.16):
The text was updated successfully, but these errors were encountered: