Images can be added to a report by using the JRXML<image>
element. Report images can be loaded from memory, from disk, or from a URL. The location from where to obtain the image is determined by the<imageExpression>
sub-element of the<image>
element.
The following example illustrates how to add an image to a report:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport name="ImageDemoReport">
<background>
<band height="391">
<image>
<reportElement x="65" y="0" width="391" height="391"/>
<imageExpression class="java.lang.String">
<!
[CDATA["reports/company_logo.gif"]]>
</imageExpression>
</image>
</band>
</background>...