1

I want generate PDF File with an image. The image name from database and physically the image is present inside local drive or remote server. I want to pass image name to the PDF.

Currently I am doing this by put an image element inside the iReport IDE designer and pass the server path or local drive path to that image.

It works fine. But I need some other type for dynamic images.

1 Answer 1

2

If the image can be reached by the app with a URL you can add a paramter named IMAGE_SRC, and specify in the iReport designer

image expression: new java.net.URL($P{IMAGE_SRC})
expression class: java.net.URL

for the image. Then at runtime you will fill the report after setting the parameter IMAGE_SRC with the value readed from the database

2
  • @soljava The editors really are Alex K and George Stocker. If this answer is useful to solve your problem you should upvote and accept it. If it isn't, you could try to explain what's wrong and we'll find another way
    – Raffaele
    Commented Jul 27, 2012 at 20:33
  • Its working fine. But , I have used directly the $P{IMAGE_SRC} without use of 'java.net.URL' and works fine.
    – JDGuide
    Commented Jul 30, 2012 at 11:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.