Using custom tags in Jasper is similar to using fields. To do so, once the tag has been created, the only thing you will have to do is copy the name and use it as if it were a parameter. To display the image-type resource, it must be placed between <imageExpression></imageExpression>.
In the following example, you can see how to use a tag with an image-type resource:
<?xml version=”1.0″ encoding=”UTF-8″?>
<!– Created with Jaspersoft Studio version 6.6.0.final using JasperReports Library version 6.6.0 –>
<jasperReport xmlns=”http://jasperreports.sourceforge.net/jasperreports” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd” name=”soat” pageWidth=”612″ pageHeight=”792″ columnWidth=”572″ leftMargin=”20″ rightMargin=”20″ topMargin=”20″ bottomMargin=”20″ uuid=”b61e5225-424a-4108-900b-a1114c933e56″>
<parameter name=”<tag_name>” class=”java.lang.String”/>
<detail>
<band height=”256″>
<image>
<reportElement x=”9″ y=”90″ width=”265″ height=”150″ uuid=”b27d51ca-bc73-4708-af4a-d9060e3410d1″/>
<imageExpression class=”java.awt.Image”><![CDATA[$P{<tag_name>}]]></imageExpression>
</image>
</band>
</detail>
</jasperReport>
NOTE: Currently, it is not possible to configure image-type resources and text-type resources within the same custom tag in Athento, because it must be known beforehand what type it has to be in order to be able to place the “imageExpression” or “textExpression” tag in the Jasper template.