【发布时间】:2017-02-18 08:43:04
【问题描述】:
我在我的应用程序中使用 ireport 工具。需要在报告中显示图像。我在数据库中有一个 blob 对象字段来存储图像。我需要在报告中将 blob 对象字段显示为图像。
但是,如果我检索除 Blob 之外的任何其他数据,它工作正常
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Blank_A4_2" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="6bf1e8fc-5bd2-495a-abca-8c4d501c73af">
<queryString><![CDATA[SELECT image FROM myimage]]></queryString>
<field name="image" class="java.io.InputStream"/>
<detail>
<band height="125" splitType="Stretch">
<image>
<reportElement x="130" y="20" width="310" height="88" uuid="8b07de5d-ac9e-4245-9ca1-ccd6fd3fe993"/>
<imageExpression><![CDATA[$F{image}]]></imageExpression>
</image>
</band>
</detail>
</jasperReport>
我收到此错误:
"net.sf.jasperreports.engine.JRException: Unable to get value for result set field "image" of class java.io.InputStream"
有什么想法吗?
【问题讨论】:
标签: sqlite jasper-reports