show a multiple image field in report

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
tmnt_2408
User
Posts: 79

show a multiple image field in report

Post 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.


arbei
User
Posts: 9384

Post 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?


tmnt_2408
User
Posts: 79

Post 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.


arbei
User
Posts: 9384

Post 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.

tmnt_2408
User
Posts: 79

Post 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.


arbei
User
Posts: 9384

Post by arbei »

You better use CSS in this case.

arbei wrote:


Post Reply