iReport输出byte[]型image:
If your field will have a byte[] as value, you need to declare the field as java.lang.Object and then cast it in your image expression
如果你的image是byte[]类型,iReprot中对应的field应设为 java.lang.Object ,image Expression如下:
Code:
net.sf.jasperreports.engine.util.JRImageLoader.loadImage((byte[]) $F{logo})
If you have an SQL query in the report to retrieve the data (and you have a fairly recent JR version), you can also try to declare your field as java.awt.Image and directly use it in the image expression.
iReport的if else :
IF boolean condition THEN
execute true code
ELSE
execute false code
END IF
Becomes:
boolean condition ? execute true code : execute false code