0

Printing an image attached to a record with html

Hello,

 

I'm struggling to include an image in a table. I've included a column with the following html which takes multiple fields and includes them in one cell in the table:

html("<b>" + Topic + "</b>" + "<br><br><i>Thema: </i>" + Frage + "<br><br><i>Feststellung: </i>" + Antwort)

There is an image in each record called "Screenshot". I try to attach it to the column as follows:

html("<b>" + Topic + "</b>" + "<br><br><i>Thema: </i>" + Frage + "<br><br><i>Feststellung: </i>" + Antwort + "<img src=" + Screenshot + "/>")

but I only get a "OBJ" instead of the screenshot itself.

 

Would love some help with this. Thanks!

4 replies

null
    • Ninox partner
    • RoSoft_Steven.1
    • 1 yr ago
    • Reported - view

    You should use the function shareFile(Screenshot)

    to get the url of the image field to display in your html formula.

      • David_H
      • 1 yr ago
      • Reported - view

      RoSoft_Steven Thanks for the answer!!

      I got the url of the image and the image itself is now displaying in the print preview. But the picture is not displaying once I print. I've already had support enable html printing. The rest of the html text is syled correctly. Any ideas?

      html("<b>" + Topic + "</b>" + "<br><br><i>Thema: </i>" + Frage + "<br><br><i>Feststellung: </i>" + Antwort + "<img src= ""https://share.ninox.com/2sf5kpz826398hj2ujj59t2gl05u4a1gcwkm"" width=""400""/>")
      

       

    • David_H
    • 1 yr ago
    • Reported - view

    I ended up doing it over dynamic templates and using the shareFile function. Also used the drop element if null in the conditioned output to drop the picture if there wasn't one:

    {d.img:ifEM:drop(img)}

    https://docs.ninox.com/en/print/print-customization/formatters/conditioned-output

     

    Thanks for the help!!!

    • Ninox partner
    • RoSoft_Steven.1
    • 1 yr ago
    • Reported - view

    👍 Great, Glad you sorted it out and also thanks for sharing your solution here. David H

Content aside

  • Status Answered
  • 1 yr agoLast active
  • 4Replies
  • 258Views
  • 2 Following