jezzerdilla Posted November 14, 2010 Share Posted November 14, 2010 Hi guys, I wonder if anyone can help. I new to Jasper reports and am having problems displaying an image from a BLOB field through Oracle.I've added an image report element to my report and changed the image expression to $F{MY_BLOB_FIELD}, I've changed the expression class.ERROR BELOWI'm sure I'm missing something obvious, any help would be great.Many thanks in advanceJezWhen I run the report i get the following error:Error filling print... Error evaluating expression : Source text : $F{ROOM_PHOTO} net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : $F{ROOM_PHOTO} at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:195) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:589) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:557) at net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:929) at net.sf.jasperreports.engine.fill.JRFillImage.evaluateImage(JRFillImage.java:1023) at net.sf.jasperreports.engine.fill.JRFillImage.evaluate(JRFillImage.java:1004) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:258) at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:499) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2033) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupHeader(JRVerticalFiller.java:621) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupHeaders(JRVerticalFiller.java:543) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:268) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:128) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:946) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:845) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:58) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:877) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)Caused by: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'oracle.sql.BLOB@2f28849' with class 'oracle.sql.BLOB' to class 'java.awt.Image' at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToType(DefaultTypeTransformation.java:327) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.castToType(ScriptBytecodeAdapter.java:602) at report2_1289732619340_640106.evaluate(calculator_report2_1289732619340_640106:247) at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:182) ... 20 more Link to comment Share on other sites More sharing options...
fenghm Posted January 5, 2011 Share Posted January 5, 2011 The steps to show BLOB field in iReport are1) Drag Image element to iReport layout2) Bind $F{IMAGE}.getBinaryStream() to image expression in properties tag. (IMAGEis the BLOB field in SQL)3) Change Expression class to java.io.InputStream Have a good tryHongMing Link to comment Share on other sites More sharing options...
teodord Posted January 6, 2011 Share Posted January 6, 2011 Hi, You should simply declare your report field of type java.awt.Image and use it in the image expressions.If it does not work, you should attach here the JRXML so that we can see what is wrong. Thanks,Teodor Link to comment Share on other sites More sharing options...
steff.mitchell Posted May 30, 2014 Share Posted May 30, 2014 This worked! Thanks! Link to comment Share on other sites More sharing options...
fadiladamsb Posted January 3, 2018 Share Posted January 3, 2018 Help, what should i do, i dont have class java.io.InputStream Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now