Page 1 of 1

show a multiple image field in report

Posted: Fri Mar 01, 2024 11:20 am
by tmnt_2408

hi all,

i have a table that has field which setup to upload mulitple image, then i want to show it in a custom summary report.

If the image is only 1, it can be shown, but if it is multiple, the image won't show.

this is the code to show the image in custom summary report:

<img class="img-fluid" src='files/usg/{{: {{{dbvalue EMR}}} }}/{{url: {{{dbvalue UploadFile}}} }}'>

kindly advise.


Re: show a multiple image field in report

Posted: Fri Mar 01, 2024 11:34 am
by arbei

Note that if you enable multiple file upload, the file name are saved as comma (by default) separated value, so your code (using dbvalue) won't work. You need to split the dbvalue, but why not use {{{value UploadFile}}} (without your own HTML) directly? Did you mean you want to use a different upload folder from the field's own/original upload folder?


Re: show a multiple image field in report

Posted: Fri Mar 01, 2024 12:01 pm
by tmnt_2408

Thank you for your reply.

The {{{value UploadFile}}} is not working in TemplateHeader, but when i move the custom report into TemplateBody, it works and the image shown, but the image is shown horizontally, so when it has so many image, it will over the layout, how to make the image shown vertically?

Kindly advise.


Re: show a multiple image field in report

Posted: Fri Mar 01, 2024 12:06 pm
by arbei
  1. Note that there is no field value in table header.
  2. To change the image alignments, you may try to modify the CSS styles, see Inspect HTML element and add your own CSS styles.

Re: show a multiple image field in report

Posted: Fri Mar 01, 2024 12:26 pm
by tmnt_2408

Thank you very much for your reply.

I change the src/phpfn.php code that contain:

    if ($multiple && count($tags) > 1) {
        return '<div class="d-flex flex-row ew-images">' . implode('', $tags) . '</div>';
    }

become:

    if ($multiple && count($tags) > 1) {
        return '<div class="d-flex flex-column ew-images">' . implode('', $tags) . '</div>';
    }

and it works.

Any clue on how to achieve this from server event? So that i don't have to edit manually from generated script.

Kindly advise.


Re: show a multiple image field in report

Posted: Fri Mar 01, 2024 1:03 pm
by arbei

You better use CSS in this case.

arbei wrote: