Forum Discussion

AndrewLe's avatar
AndrewLe
Qrew Trainee
5 years ago

Displaying images on reports

Hello all,
I have a question regarding getting images to display on reports. I am currently trying to get images that are uploaded to quickbase to also display in reports as regular images. However, I am having difficulty getting the code to properly work.

-----

I've found that the code works if I code the field such that a specific image address is hard coded into the rich text field, I can get an image to display, but since it's hard coded to a specific image, all the rows display the single image that was hard coded.

What I really want is for the code in the "Photo" field to dynamically look at that record's "Photo File" address and display the image connected to that record's photo file.

This is the code that I currently have in the Formula - Rich Text code for the "Photo" field:
"<img src=https://xxxxxxxxx-####.quickbase.com/up/xxxxxxxxxx/g/rc/ej/va/"&Right([Photo File],"va/")
I did notice that the > symbol is missing, but the only place that quickbase will allow it is at the end of va/, which just cases it to behave like the example lines of code below. Additionally, when I try to put it on the end like in the second example line of code that I've shown below, quickbase returns a syntax error.

This is the code that works when I hard code a specific image:
"<img src=https://xxxxxxxxx-####.quickbase.com/up/xxxxxxxxxx/g/rc/ej/va/IMG_2294.jpg"&"height=100>"
Note: if I were to also hard code the following line of code, I can get the same behavior:
"<img src=https://xxxxxxxxx-####.quickbase.com/up/xxxxxxxxxx/g/rc/ej/va>"

Note: I've removed some private identifying information from the code.

What should I be doing to get the images to display properly? Thank for you help and suggestions.

------

I have also included a screenshot of the what I'm hoping to achieve from this report:



------------------------------
Andrew Le
------------------------------

14 Replies

  • try this

    "<img src=" & URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e7/v0" & "\" width=\"50\">"

    in the above example the image is stored on field ID 7.  Play with either the width parameter or replace with a height parameter (but not both)

    This probably will work too, with less syntax

    "<img src=" & URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e7/v0 width=50>"

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    markshnier2@gmail.com
    ------------------------------
    • AndrewLe's avatar
      AndrewLe
      Qrew Trainee
      That works perfectly, thanks for the help!

      I do have a second (and hopefully last for this topic thread) question though, my pictures that are normally in portrait orientation are being turned over on their sides into landscape orientation. Is there anything I can do to ensure that picture maintain their correct orientation?

      ------------------------------
      Andrew Le
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Qrew Champion
        Alas, I think that question has been asked on the forum before with no answer at present.  I think that users would hoping that Quick Base would be able to look at the data stored with the picture and read and correct for orientation.  There may be a User Voice suggestion about that.

        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        markshnier2@gmail.com
        ------------------------------
  • I can't recreate the orientation problem. I uploaded one image in both portrait and landscape orientations and they are shown as expected:

    Do you have more details about the pictures; i.e. file format, size, etc...?


    ------------------------------
    Adam Keever
    ------------------------------
    • AndrewLe's avatar
      AndrewLe
      Qrew Trainee
      Sure,

      The photos were taken on an iOS device and imported into windows as typical HEIC files, they were then converted into jpg's using heictojpg.com

      They are imported into quickbase as jpg's, as either 3024x4032 or 4032x3024 depending on the orientation. The images range anywhere between 0.5 MB to 1.5 MB

      ------------------------------
      Andrew Le
      ------------------------------
      • AdamKeever1's avatar
        AdamKeever1
        Qrew Commander
        Can you shrink the size down before import? I am wondering if there is a size limitation that is forcing the images to landscape. The file I tested was only 584 x 198.

        ------------------------------
        Adam Keever
        ------------------------------