Are you using jasper report as java reporting and have to put image such a logo, photos, etc inside of it ? Many article I found trough my favorite search engine end me up to use direct file path as it (Jasper Report) Image Expression, use default properties (direct file path) is fine, but makes image file must keep in the place as written in Image Expression whereas you can send the Image from java trough parameter and set is as Image Expression and let your java layer/application control the image location.

Ok, here we go, first make Parameter or Field (choose based on your need) in Report Inspector, don’t forget to set it Paramter/Field Class into java.awt.Image. Then simply drag and drop Image from Palette into inside your Jasper Report, click and set it Properties-Image Properties like picture below :

Image Expression following field or parameter, and it Image Class is java.awt.Image, done. What you need now is send your java.awt.Image from java to Jasper Report. Easy isn’t? Hope the post helpful and don’t forget to follow my twitter for brand new post about java😉.