mysql - How to insert images from database? -
i want insert images database in details band in report in jaspersoft studio.
jpg-images saved in mysql in field imgdata of type longblob.
i`v tried put expressions in image element:
$f{imgdata}
myutil.getinputstream($f{imgdata})
in first case error:
net.sf.jasperreports.engine.jrexception: net.sf.jasperreports.engine.jrexception: unknown image source class [b
... , in second case error:
net.sf.jasperreports.engine.jrexception: net.sf.jasperreports.engine.fill.jrexpressionevalexception: error evaluating expression : source text : myutil.getinputstream($f{imgdata})
my question: how insert images database jasperreports's report?
open xml view of .jrxml file. find code similar
<field name="image" class="java.lang.object"/> /* "image" must replaced actual field name */
and change
<field name="image" class="java.io.inputstream"/>
Comments
Post a Comment