Wednesday, September 18, 2013

To show Image in jasper report from BLOB field of MySql Database

Normally we save image in the blob field of mySql database table. To get that image  in the report page of jasper report we need to follow some steps.

1.set your field class type:    java.io.InputStream
2.Write Image Expression :     JRImageLoader.loadImage((byte [ ] )
                               (JRLoader.loadBytes($F{ImageData})))
                                ImageData is the Blob field in the table.
3.Image Expression Class :      java.awt.Image
4.add the following include

  
 

2 comments:

Unknown said...

where can i find the image expression in the jasper report?

rajit said...

See Right hand corner on bottom