好吧,解决方案其实很简单,多亏了
@dada67
。
首先,我混淆了$P和$F,因为我使用的是字段,所以必须使用$F。
然后,解码base64是个错误,我不需要它。总而言之,正确的代码应该是:
<field name="logo" class="java.io.InputStream"/>
// ... other stuff that is displayed properly
<image scaleImage="FillFrame" onErrorType="Blank">
<reportElement style="Column header" x="0" y="-1" width="80" height="75" backcolor="#333333" uuid="80bcba32-4e50-4a3a-949c-39e7c22ddff4"/>
<imageExpression><![CDATA[$F{logo}]]></imageExpression>
</image>
还有:
//a big bunch of fileds that I managed to display properly
private InputStream logo;
public Constructor(some, stuff, imageAsByteArray) {
// setting lots of things that are displayed properly
this.setLogo(new ByteArrayInputStream(imageAsByteArray));
}
P.S:我会删除这篇文章,如果
@达达67
想公布他的答案,因为所有的学分都是他的。