aspose file tools*
The moose likes Other Open Source Projects and the fly likes [Japser Report] Displaying image from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "[Japser Report] Displaying image from database" Watch "[Japser Report] Displaying image from database" New topic
Author

[Japser Report] Displaying image from database

Vikas Kapoor
Ranch Hand

Joined: Aug 16, 2007
Posts: 1374
Has anybody ever been able to display image on the report without saving it into local drive? I am working hard but no success since last three days.

Various options to display image are

* net.sf.jasperreports.engine.JRRenderable
* java.lang.String
* java.io.InputStream

I have tried above three options. The second option works as I pass the path and image is stored in to local drive. But first and last option doesn't work. I get byte[] of image from database(blob --> byte[]) and I pass it to ByteArrayInputStream class. But it doesn't work.

I have also tried JRRenderable option but no success.

Can somebody tell me what am I missing?


PS : Size of imageByteArray is not zero. I have verified that. Cross Post
Vikas Kapoor
Ranch Hand

Joined: Aug 16, 2007
Posts: 1374
I took a bird's eye view into JRImageRenderer class from source code and found below code snippet,

Here, imageLocation variable is of String type but If I have passed an object of InputStream then how come imageLocation variable would get initialized?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [Japser Report] Displaying image from database