Skip to main content
Solved

Display Thumbnail Image

  • January 13, 2025
  • 0 replies
  • 524 views

Forum|alt.badge.img+5

I have a field to display a thumbnail image;the formula is If([Image File (jpeg)]<>"" ,"<img style='max-height:200px; max-width:200px' src='" & URLRoot() & "up/" & Dbid () & "/a/r" & [Record ID#] & "/e30/v0'/>")

The image is not showing in the Form or Report view. 

Is the formula the issue?

 

Best answer by MarkShnierYou

John, change the e30 to e21 and it should work.  The formula needs to know which field has the image attachment.

MarkShnierYou
Forum|alt.badge.img+24

I'm not sure why yours is not working.

 

here is one that I use which will defat coaching if you change the name of the image file by uploading a new file attachment. 

<img src=" & URLRoot() & "up/" & Dbid()
& "/g/r" & QB32Encode([Record ID#])
& "/e" & QB32Encode(12) // 12 is the fid of the file attachment field
& "/va/" & URLEncode([Picture]) // my file field is called [picture]
& " width=30>"


Forum|alt.badge.img+5
  • Registered
  • January 14, 2025

When I run into these issues I try to first break down my formula into parts to figure out which part is causing the problem. 

  • Have you double checked that your file attachment field id is in fact 30? 
  • If you remove the style attributes entirely but leave the rest of the formula, does your image show up (albeit full size)? If so, your file access URL is at least correct.
  • If so, and you remove the style attributes and just use "src = '...' width='200px'" (not inside of style) does it work? If not, try '200', '200pt', etc. (Probably just me not knowing how to use HTML properly, but I've sometimes found success with changing units). If that works, your max-height/max-width attributes may be causing the problem (I've had this happen before, but I ended up resolving it by hardcoding in the aspect ratio for scaling properly).
  • If the image does not  appear after removing the style attributes, try checking the "allow open access" box on the File Attachment field settings. This is necessary if you are wanting to insert the image into an Exact Forms Plus document or similar, but I've found it sometimes seems necessary within the application itself, too. 

     


MarkShnierYou
Forum|alt.badge.img+24

John, change the e30 to e21 and it should work.  The formula needs to know which field has the image attachment.