Search code examples
jasper-reports

JASPER iReport - Display 2 images in a row in a detail view


I have a SubReport that gets a list of files paths via JRBeanCollectionDataSource. This SubReport has a Title and a Detail band. At this stage the Detail band has only one Image.

Everything works fine but each Image is displayed in one row of the Detail band.

enter image description here

Is it possible to display two images next to each other per row for a n-amount of images? That means if there are 3 images for example, the Detail band would have 2 rows; the first containing 2 images and the second containing one image.

enter image description here

Thanks for your support, Thomas


Solution

  • You can do that with a report that has two horizontally-filled columns.

    The report would specify

    <jasperReport columnCount="2" printOrder="Horizontal" pageWidth=".." columnWidth=".." columnSpacing=".." ...>
    

    The detail band would contain a single image element (sized within the column width limit).