Implementing Thumbnails in Jasper Reports

There are two possible approaches to display low resolution images in a Jasper Report:

  1. Explicitly setting up the width and height of image container.

  2. Using the thumbnail image instead of the original image (Recommended).

    Upon uploading an image in CMiC, the system creates two thumbnail images along with the original image in the same directory.

    In the screenshot below we can see two thumbnail images have been created, with ‘_thumb_hi’ and ‘_thumb_lo’ suffixes being added to the original file name.

    To implement this method, the thumbnail image path needs to be created in the Report View

    using the original file name.

    After modifying the Report View, the following expression can be used to display a thumbnail

    when the thumbnail flag is "Y", otherwise the report will display the original image.

    The query below provides an example of how to get this information:

    select (SUBSTR(pma_path, 0, INSTR(pma_path, '.') - 1)||'_thumb_hi.jpg') thumb_hi

    ,(SUBSTR(pma_path, 0, INSTR(pma_path, '.') - 1)||'_thumb_lo.jpg') thumb_lo

    ,doc.sysrd_thmbnl_flag sysrd_thmbnl_flag

    ,att.pma_path pma_path

    from da.SYSRELATEDDOC_V doc

    ,da.pmattachment att

    where doc.sysrd_object_oraseq = att.pma_object_oraseq;