How Add a background image from subdataset in JasperSoft Studio?

Hi. I have TIBCO Jaspersoft® Studio 6.8.0 and Oracle's JDBC driver version 7 to connect to Oracle database XE.
I have a report with a main dataset which is based on a query. And a background image that's retrieved through a different query. 
I can not add the image field of the subdataset to the background band. 
So, how Add a background image from subdataset in JasperSoft Studio?
I appreciate if there's a better way to accomplish the task. Thanks.

Eyesmagicx's picture
Joined: Jun 24 2019 - 7:09am
Last seen: 9 months 2 weeks ago

1 Answer:


JasperReports Library executes SQL queries only for the purpose of retrieving data source records and iterate through them.

In your case, you want to execute an SQL query just to fetch an image, which probably requires some custom code.

But one way to leverage JRL ability to fetch images from the database is to use a master report just for the background.

The master report would have the query to fetch the image as a dataset field and put it in the background section.

The actual report content is included in this master as a subreport.

This approach would solve the page margins issue you raised on a separate thread.

I hope this helps.

teodord's picture
Joined: Jun 30 2006 - 9:00am
Last seen: 12 hours 54 min ago