How to print images in a report?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Christian Lietzke
    Junior Member
    • Jul 2021
    • 14

    How to print images in a report?

    Hi,

    is it possible to print thumbnails of images within a report?

    We try to create a report which contains products that are marked as belonging to a certain group.
    The Report lists the group, the description and the image/thumbnail. So far, everything works as it should.

    When I try to print the report as pdf, I get a list with the group and the description. In the place where the image should be is just the "link" to the image, looking like

    <img src=data/upload/62cc2927b94c3928c>

    which is the correct link to where the image is stored, but that actually doesn't help.
    What can I do to print the image and not the link?

    EDIT:
    When I try to export the report to excel, the images are exported as intended. Seems to be a problem with the "print2pdf" function.


    Kind regards,
    Chris
    Last edited by Christian Lietzke; 08-01-2022, 09:27 AM.
  • Christian Lietzke
    Junior Member
    • Jul 2021
    • 14

    #2
    Hmm... no replies could mean that I should clarify the problem or nobody knows an answer. I hope it's the first option.

    So If I create a report (german: Bericht), it looks like the first picture. When I export the report to excel the result I get is the second picture. Everything works fine. When I export the report to pdf I get what it shown in the third picture. Just the link to the location of the image, but no image. As if tcpdf would not know what to do with the picture.

    Hope this helps finding a solution... or just a "doesn't work"... would be ok, too. Then, at least I could stop looking for a solution and could tell my boss that it will not work.

    Kind regards
    Chris

    Comment

    • rabii
      Active Community Member
      • Jun 2016
      • 1250

      #3
      you need to create your own template for the report and add printing an image function like this

      Code:
      {{imageTag beispielbildId width=50 height=50}}
      Rabii
      Web Dev

      Comment

      • Christian Lietzke
        Junior Member
        • Jul 2021
        • 14

        #4
        Originally posted by rabii
        you need to create your own template for the report and add printing an image function like this...
        And this works fine for me... just not within a report.

        The default report contains this code:
        Code:
        {{name}}
        {{reportTable border=1 borderColor="#333" cellpadding=1}}
        When I put the imageTag within the curly brackets, nothing happens. Same when I add the code in its own brackets.
        But I don't think that it would work that way.

        The report template is, if I understand it correctly, for the conversion of the report to pdf.
        Problem is, the report itself is not the entity that contains the field "Beispielbild", so I can't link/tag to it.
        When I try to convert a record within that entity to pdf, the imageTag works fine, just not in a report.


        Comment

        Working...