This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: [Japser Report] Displaying image from database
 
Similar Threads
print a report (client side)
JasperReport problem
Jasper report - Change Page Orientation
Problem with Jasper report
[Jasper Report] Can't render image