我在我的应用程序中使用了ireport工具。有要求在报告上显示图像。我在数据库中有一个blob对象字段来存储图像。我需要在报告中将blob对象字段显示为图像。如何使用sqlite数据库中的JasperReports显示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"
有什么想法?
这个帖子可以帮助您:?如何查看从BLOB列的图像在Oracle中的JasperReports(HTTP:// stackoverflow.com/q/12272283/876298)&[在使用PostgreSQL的Ireports中显示图像](http://stackoverflow.com/q/8430313/876298)&[如何从碧玉中导出数据库中blob的图像(http://stackoverflow.com/q/33894102/876298) –