为什么 Jasper Reports 在服务器中显示空报告,但在 jasper studio 中正确生成

2023-12-14

我正在使用 Jasper Studio 6.6.0 和 Jasper 服务器 7.1。

我使用来自指定 URL 的图像创建了一个简单的报告。

它在 Jasper Studio 中正确生成,但在服务器中显示为空。

请参考附图:

Server Screenshot server screenshot Jasper Screenshot jaspersoft screenshot


如果您想在没有数据源或空数据源的 JasperReport 中显示某些内容,那么您有两个选择:

1) Set the When No Data Type property on All Section No Detail option in the Jasper Studio: When No Data Type

在 JRXML 中,可以通过设置来完成whenNoDataType="AllSectionsNoDetail"根上的属性<jasperReport>元素。

2) Or you can move content you want to show when there is no data into No Data band of the report: No Data Band

在 JRXML 中,可以通过添加以下内容来完成:

<noData>
    <band height="110">
        <image>
            <reportElement x="0" y="0" width="240" height="110" uuid="d4b9e59b-896e-4881-92a2-c6707c975312"/>
            <imageExpression><![CDATA["https://my.image.url/getImage?name=penguin"]]></imageExpression>
        </image>
    </band>
</noData>

JasperReport默认没有数据时呈现空白页,JasperServer显示报告为空,因此从上面的选项中选择您希望能够显示您想要的图像的选项。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

为什么 Jasper Reports 在服务器中显示空报告,但在 jasper studio 中正确生成 的相关文章

随机推荐