Ruchi
Ruchi

Reputation: 5192

display multiple images in jasper sub report dynamically using looping

I have one master report with sub report.

in master report display single value for each field but in sub report value fetched dynamically and multiple values.

in sub report i need to display num of images in loop.

how to apply this in ireport/jasper report ?

like

enter image description here

these images coming dynamically in sub report.

Please suggest..

Upvotes: 1

Views: 2843

Answers (2)

mdahlman
mdahlman

Reputation: 9390

You'll need to set the subreport to use multiple columns and to fill horizontally.

Upvotes: 1

Shehzad
Shehzad

Reputation: 2940

You have to convert your images to InputStream dynamically. Then set image tags value expression to this input stream field.

i.e

InputStream inputStream= Convert your image to inputstream//
yourSampleJavaBean.setImage(inputStream);

now use yourSampleJavaBean.image variable as image expression value. It will change the images dynamically with each row.

Upvotes: 1

Related Questions