Jump to content
Changes to the Jaspersoft community edition download ×

Loading byte array from database and displaying it as image!!


vivek4348

Recommended Posts

 Hi all,

               I wish to display images on my report. These are stored in SQL server as varbinary fields. Can anyone here please tell me the procedure of how to display images (in byte[]).

I did exactly what is mentioned in

http://rgauss.com/category/interface/---getting no such method exception...

and  http://vmustafayev4en.blogspot.com/2011/08/read-alfresco-node-to-byte-array-in.html-- here I am getting java.lang.ArrayIndexOutOfBoundsException: -77.

 

Thanks,

Vivekanand Alampally.

 

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi Vivekanand,

I haven't used SQL server only MySQL but I assume the image is converted to the same java Object.

logo is the SQL field. i.e select logo from company;

Hope it helps.
Munga

Code:
<imageExpression class="java.io.InputStream"><![CDATA[((java.sql.Blob)$F{logo}).getBinaryStream()]]></imageExpression>
Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...