Jump to content
Changes to the Jaspersoft community edition download ×

Loading image from DB


Recommended Posts

By: Raj - rajs1

Loading image from DB

2002-09-19 09:18

I am new to Jasper so please bear with me.

 

I need to retrieve an image (gif) from the DB and insert it into the report.

 

Ideally I would like to add it as a parameter at run time (map it to a variable name) so that the XML will just have a placeholder such as ${Logo}.

 

Is this possible? How?

 

Cheers

-raj

 

 

By: Teodor Danciu - teodord

RE: Loading image from DB

2002-09-24 07:17

 

Hi,

 

The only thing you have to do is to declare a report field of type java.io.InputStream that will point to the table column that stores the GIF files.

 

Then, in the <imageExpression> tag you use this field directly like this:

 

<imageExpression class="java.io.InputStream">$F{MyImageField}</imageExpression>

 

I have tried it once and it worked. perfectly.

 

I hope this helps.

Teodor

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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...