I need to put images in my Jasper reports that match rows in a database. I have the image data in proprietary archive files which I can easily extract in Java code. I need to know how to connect my Java code to the Jasper report to make the extraction process happen, something like BIRT's onRowSets() method. (I need overview documentation about how the fill process works.)
If I define a POJO/bean data source, I won't be able to easily use the database as well. Can I embed the necessary Java extraction code right in the XML? This example at the Jasper Assistant site seems to indicate that I can:
<imageExpression class="java.io.File"> <![CDATA[(new File($P{BaseDir}, "logo_"+$P{ReportCollecter}+".gif").exists()) ? new File($P{BaseDir}, "logo_"+$P{ReportCollecter}+".gif") : new File($P{BaseDir}, "logo_BLANK.gif")]]> </imageExpression>
Is that new File() actually Java code embedded in the XML? I'm willing to write code, but I can't seem to find any complete class code examples (I think I want something like an extended image object).