• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[Japser Report] Displaying image from database

 
Vikas Kapoor
Ranch Hand
Posts: 1374
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1374
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic