camiloavila Posted August 8, 2006 Share Posted August 8, 2006 hey dudes! im trying to insert an image from the report query, do you know how could i do that? i dont want to use an image from a file...:ohmy: Link to comment Share on other sites More sharing options...
Giulio Toffoli Posted August 9, 2006 Share Posted August 9, 2006 Is the image stored in a BLOB field? Link to comment Share on other sites More sharing options...
camiloavila Posted August 9, 2006 Author Share Posted August 9, 2006 hey, yes it`s a long raw field in the data-base Link to comment Share on other sites More sharing options...
Giulio Toffoli Posted August 10, 2006 Share Posted August 10, 2006 Set your image expression to: new java.io.ByteArrayInputStream((byte[])$F{MyField}) and the image expression to: java.io.InputStream Giulio Link to comment Share on other sites More sharing options...
camiloavila Posted August 11, 2006 Author Share Posted August 11, 2006 well, our image in the database gave us a byte[]. when we try the image expression (new java.io.ByteArrayInputString[]($F{myfield}))the ireports bring us back this error :Errors compiling .Reporte_1.jasper!it.businesslogic.ireport.ReportClassLoader@9d515 509512Â[Thread-25]ÂERRORÂdigester.DigesterÂÂ-ÂParseÂErrorÂatÂlineÂ33ÂcolumnÂ41:ÂAttributeÂvalueÂ"byte[]"ÂofÂtypeÂNMTOKENÂmustÂbeÂaÂnameÂtoken.sorry but we´re donkies:blush: Link to comment Share on other sites More sharing options...
camiloavila Posted August 11, 2006 Author Share Posted August 11, 2006 hey sorry is not (new java.io.ByteArrayInputString[]($F{myfield})).is (new java.io.ByteArrayInputStream[]($F{myfield})).the error is still there...:S Link to comment Share on other sites More sharing options...
lucianc Posted August 11, 2006 Share Posted August 11, 2006 If you use a fairly recent iReport version, you can try to directly set the type of your field to java.awt.Image, the JasperReports engine would read the binary data from the DB and convert it to an image. Then you would simply use $F{MyField} as the image expression. HTH,Lucian 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