iReport - print an image field which is a BLOB in the db

For those who got the Open Source fever, sharing only makes you hot!

Moderator: neilg

iReport - print an image field which is a BLOB in the db

Postby neilg » Tue Nov 22, 2005 10:15 pm

Place an image on your report.

Select the field which is a BLOB out from the database in your select statement. Set the field type as 'Object'.

Set the 'Expression field type' for the image as InputStream.

Put as the expression field for the image:

Code: Select all
((java.sql.Blob)$F{MYBLOBFIELD}).getBinaryStream()


Every time you modify the SQL query you must remember to change the field's type from string back to Object
neilg
Regular
 
Posts: 141
Joined: Thu Jun 16, 2005 1:58 pm

Return to Contributor's Corner

Who is online

Users browsing this forum: No registered users and 1 guest

cron