我想导出图像(字节数组)并使用iReport在PDF中显示。 Groovy代码:显示图像导出为JasperReports中的字节数组
InvoiceVO invoiceVO = new InvoiceVO()
invoiceVO.kms = 5
..............
invoiceVO.image = currentUser.profile.image // byte array
在iReport的我使用:
<image>
<reportElement x="2" y="7" width="143" height="32" uuid="df5cd1ab-e7a2-41a1-920d-6045db41cfc9"/>
<imageExpression><![CDATA[net.sf.jasperreports.engine.util.JRImageLoader.loadImage($F{image})]]></imageExpression>
</image>
,但它不工作。字段图像的类型是“java.lang.object”,也尝试过“java.lang.byte”。图像表情占位符显示空白。
',但它不是working' - 这是什么意思(有一些错误,...)?什么是'$ F {image}'类型? –
java.lang.object也试过java.lang.byte –
我更新了这个问题。它在图像占位符中显示空白。 –