Input images in Base report using relative links

Hello,

I didn’t find a solution for my current issue:
(for information, I used LibreOffice 7 with a Firebird embedded database, on a Debian desktop).
In a report (Base), I want to display pictures that are not attached in the database but referenced through their file name.

Based on this thread, I could correctly display a picture in the report, by providing the full file path in the adequate field.

But what I would like is to work with relative path better than full absolute links (note: picture are stored locally, not online).
Indeed, the database+pictures folder will be shared to other people, using different desktop OS, and probably placed in different locations in the target computers.
In other words, I would like that the report adequately display the pictures if the working folder is placed for example in:

  • /home/greb/documents/database/, and
  • C:\Documents\Current_jobs\material\

Is there a way maybe through the formula function in the “Data field” field of the image control?
(Ive tried the URLENCODE function, but not sure that it’s the appropriate function, and don’t know how to use…)

Thanks a lot in advance for any help or tip!

Hello,

Relative links seem to work just fine. Using Ubuntu 20 with LO v7.0.2.2 Firebird embedded.

Have MyPictures directory in same location as Base file. Have PictureZip/picture_links one level up. These links work in both forms and reports:

MyPictures/image.png

../PictureZip/picture_links/another_image.png

Also copied & moved to a different location without problem.

When entering new images on a form (links not embedded), relative location is saved.

Also did quick test on Win 10 - no obvious problems using same files copied over to there.

Hello @Rastlinger
Thanks a lot for your help.

I’ve tried it following your exact folder structure with a new test Base file and indeed, it works.

The thing is in this test Base file, i’ve created the table to be displayed in the report (with a VARCHAR field for the picture path), while in my working file, what is used for the report is a view (designed query).
I don’t know why, the field containing the image path yielded with a lot of space at the end… (and the field relating to the image path is a CHAR one, but don’t know if involved in the issue).
Using the TRIM() function resolved my problem (and also produced a VARCHAR field).