I'm using this snippet to load image in my report :
new java.io.StringBufferInputStream(new org.w3c.tools.codec.Base64Decoder([Variable]).processString())
This is working on JasperStudio Professional. When i switch to Community Edition 6.5.1 (removed the other edition due to near expiration), this portion doesn't work and says that
org.w3c.tools.codec.Base64Decoder cannot be resolved to a type.
How can i resolve this error?
You are probably getting error because you do not have in your classpath any *.jar containing org.w3c.tools. It used to be a part of jasperreports.jar until version 6.4.3.
Jaspersoft Studio CE 6.5.1 is using jasperreports in version 6.5.1.
There are few alternative solutions you can use to fix this:
1. Download library that contains org.w3c.tools.
- You can download jigsaw.jar package from https://mvnrepository.com/artifact/org.w3c.jigsaw/jigsaw/2.2.6
- Place it either to your project folder (better) or some other location (worse, but still ok).
- In JasperStudio click with RMB on your project (in project explorer). Choose buildpath from the menu. Window should open where you can 'Add JAR' (if jar is in the project) or 'Add External JAR' (if it is in external folder).
- Add jigsaw.jar to your buildpath, apply changes and enjoy.
2. Replace snipplet with one using only classes available in jasperreports 6.4.3+ and build-in java:
net.sf.jasperreports.engine.util.JRImageLoader.getInstance(new SimpleJasperReportsContext()).loadAwtImageFromBytes(javax.xml.bind.DatatypeConverter.parseBase64Binary([Variable]))
3. Download and use Jaspersoft Studio CE 6.4.0 or earlier