then change the expression class of the image element on the layout to java.awt.Image as well. You’ll also have to add javax.imageio.ImageIO to the imports of the report.

This technique can be useful when you need to grab the image data dynamically (not from actual files on the filesystem), you can’t get each image from a URL (perhaps due to security constraints), and don’t want to use a custom Java datasource.

Like this:

LikeLoading...

Related

Can you please tell us how did you import the Base64 class for the report?
I’m also trying to import a third party library class file to be used in a variable expression and even if the .jrxml has the proper import statement and the .jar file containing this third party class is copied to [JasperSoft\iReport-4.0.1\ireport\lib], i still cannot use the third party class. I get an error while trying to compile the report with iReport – [some third party class] cannot be resolved.
Thank you

I haven’t used iReport 4 yet but in 3.7 I did not have to add jar files to iReports environment. I like to keep application instances (like iReport) as generic as possible to ease upgrades and collaboration.

In the import properties for the report I do have the Apache commons’ Base64 as an entry along with ImageIO and others, and in the application properties classpath I have a reference to my project’s config files, but not the jars, so I’m guessing I happen to have the Apache commons jar somewhere else on my default classpath.

I would suggest placing your needed jar somewhere other than inside iReport and add a classpath entry in the iReport application properties pointing to that, then double check that the report’s import entries are correct.