Forum Discussion

JerelJohnson's avatar
JerelJohnson
Qrew Member
29 days ago

Need assistance getting image to show when printing a record

Created a form that has a file upload section. This section allows people to submit photos of themselves. This is used for Medical purposes, we need to print out records to include the uploaded image. 

Initially this worked as intended by displaying the picture when printing. Once this was officially put in production, it stopped displaying the image as intended.

the test record:

 

Print preview: 

The print preview used to show the uploaded image on the record but now its just the file name.

  • Mez's avatar
    Mez
    Qrew Cadet

    Mark has your solution within this post. One field for the file, another (rich text using '<img ... /> tag) to display it. 

    https://community.quickbase.com/discussions/quickbase-discussions/thumbnail-pictures-refreshing-slowly/30113

     

    • JerelJohnson's avatar
      JerelJohnson
      Qrew Member

      So, I have this set up already. The formula used:

      If(Length([Attachment File])=0,"","<img width=\"30\" src=\""&URLRoot()&"up/"&Dbid()&"/a/r"&[Attachment ID#]&"/e7/v0\"/>")


      To create this is the same, and this worked initially. It seems over time, print preview just stopped displaying the image.

  • Mez's avatar
    Mez
    Qrew Cadet

    Is 7 in "e7" the field ID for "Attachment"?

    I had trouble with getting the field to display the image at first, mostly because of the file name. This is how mine looks:

    // _fid_24 = photo_attachment
    If( Length([Photo Attachment]) > 0,
        "<img class='img img-thumbnail' name='" & [Photo Attachment] & "'width='300px' src='" & URLRoot() & "up/" & Dbid() & "/a/r" & URLEncode([Record ID#]) & "/e24/v0/" & URLEncode([Photo Attachment]) & "' />",
        "<img class='img img-thumbnail' name='default' width='300px' src='' />"
    )

    • MarkShnier__You's avatar
      MarkShnier__You
      Icon for Qrew Legend rankQrew Legend

      I have used this syntax in the past to have a clickable thumbnail which will open full size when clicked.  replace e12 with exx where xx is the file attachment fid.  Does this syntax wortk for you for both a thumbnail ands the full size click and the printing.  if the printing does not work, then  try looking for the print setting to enable background graphics (Chrome)

      var text image= "<img src=" & URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e12/v0' height='100' >";
      var text URL= URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e12/v0' target=_blank";


      If([Team Member Picture]<>"", 
      "<a href=" & $URL & ">" & $Image & "</a>")