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.

4

1 回答 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

于 2012-07-26T14:34:03.960 回答