To add dynamic images to your report, use the content-field report element . The content field accepts different types of image inputs for rendering. The first approach is dynamically changing the image location within your dataset. If you have a field that contains a URL or file system location to your image, the content-field element will render the specified image.
The second approach is to populate the content-field with an object of type java.awt.Image
for rendering. This approach would require a custom-implemented TableModel
(as described in Chapter 5), or a custom function that returns an Image
object.
The third approach is to populate the content-field with an object that contains the following method, which is determined through Java introspection:
void draw(Graphics2D g2, Rectangle2D area);
In addition to this API, Pentaho Reporting also defines an extended org.pentaho.reporting.engine.classic.core.util.ReportDrawable
API with the following...