我想導出圖像(字節數組)並使用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 –
我更新了這個問題。它在圖像佔位符中顯示空白。 –