Jump to content

Load images in table and in legend of the stacked bar


macaxrc

Recommended Posts

Hi everybody,

I use iReport a JasepserServer 5.5a

I need help to load images depending of the query value.

I'm new in jasper and I don't find any example.

I have this query:

select a,b,c

from table

When value of field a is 1 I need to load image 1, when values is 2 load image 2.

Anyone have any examples of how to do?

 

I need the same but in a legend, but this don't depending with the query value, I like to change the legend type to an image.

Thanks and sorry for my English

 

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

My suggestion is to try to use Jaspersoft Studio instead of iReport, Studio has a built in "IF" function that would be helpful for you. I have an example here:

IF($F{product_family} == "Food","http://images.clipartpanda.com/food-clip-art-Burger1_Food_Clipart.png","http://images.clipartpanda.com/drink-clipart-drink_06.gif")

Otherwise youll have to use a teryary statement as explained in this post: https://raymondhlee.wordpress.com/2012/10/06/if-else-in-jasper-reports-expressions/

Regarding the image in legend: you probably need to ask in a different question and be specific about which charting library you are using! Probably easier to make the legend manually outside of the chart element

Link to comment
Share on other sites

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