Ask Your Question

External Links to Images in Base Reports? [closed]

asked 2014-01-05 20:45:43 +0100

Harris2508 gravatar image

I have worked out the matter of putting links into Forms so that photos can be referenced from OUTSIDE the database using a text field in a table. However, I am not finding the same capability in the Reports module. The only suggestions I've found so far are to embed the images in a table and then use that to put images into the Report. This seems to defeat the purpose since (in my experience anyway) the database gets unstable with a bunch of photos. There would be about 160 jpg photos in this database. So I'm interested in determining if the external links can be made to work with Reports. If not, then I will probably have to find a totally different tool for this database. The database is for an organization that my wife is part of and she volunteered me (!) to do this database for them. Nice, huh?? :)

Thank you very much! Any suggestions are very much appreciated.

Bob Harris

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-02-18 11:37:13.201488


Some questions: 1. Perhaps you might explain the exact steps you have tried using linked images in the RB module. 2. Do you get (Java) errors when running the report? 3. What computer platform are you using? 4. Do your reports run with images from other sources (such as single fixed images or images stored in your database)?

NOTES: The RB's tools and interface is a bit different from those available in FORMS. There seems to a bug using image controls in reports affecting Mac OSX - see HERE. Not sure if it affects other platforms.

frofa gravatar imagefrofa ( 2014-01-05 21:10:42 +0100 )edit

The bug mentioned above for Mac OSX no longer applies in 4.2.x or 4.3.x

Alex Thurgood gravatar imageAlex Thurgood ( 2014-08-11 10:26:03 +0100 )edit

1 Answer

Sort by » oldest newest most voted

answered 2014-01-05 22:25:29 +0100

bencomp gravatar image

You can insert a graphic in a report by setting the data field to a text field that contains an URL. I just tested this on my Windows 7 computer with LibreOffice

The table or query that the report is based on should contain a text field (a VARCHAR_IGNORECASE field worked for me, but it may not if your operating system uses case-sensitive file paths) that contains the URL of the image. If the photo is on your local computer (e.g. on Windows: D:\Documents\ben.png) the URL should have the file:/// prefix, and backslashes replaced by forward slashes. In my example I put file:///D:/Documents/ben.png in the database field. You can also point at online URLs starting with http://.

To include the image in your report, insert an Image Control (Insert menu > Report Controls > Graphic...). On the Data tab in the properties of the control, choose Field or Formula as Data Field Type and the column name containing the URL as Data Field.

In my quick test, I was able to produce this report:

image description

Note that the images (in my case a local PNG and an external GIF) are stretched to the dimensions of the control, so you want to use photos that have been cropped to a single ratio that matches the ratio of the control's dimensions.

edit flag offensive delete link more


bencomp: Thanks for your answer. Unfortunately, it does NOT work on my Mac OSX.6.8 - I just get a screen with a lot of Java errors. I note using linked images in a FORM does not require the full file-path (just the image filename if it's in the same directory as the database).

frofa gravatar imagefrofa ( 2014-01-05 23:12:17 +0100 )edit

Could you add details about your OS and LO version to the question? Oh, wait, it's not your question :)

What kind of Java errors do you get? I hadn't tried relative file paths, but interesting to know that could work too.

bencomp gravatar imagebencomp ( 2014-01-05 23:23:38 +0100 )edit

I'm using LO version The same problem occurs for AOO version 4. Java errors (below):

    OpenOffice Base The document "Report1 could not be opened.

Oni_uno bridge error] UNO calling java method execute: non-UNO exception occurred: java.lang.NoClassDefFoundError: Could not initialize class java.aw1.Dimension
java stack trace: java.lang.NoClassDefFoundError: Could not initialize class java.awt.Dimension
at URL(
at ...
frofa gravatar imagefrofa ( 2014-01-06 00:19:24 +0100 )edit

Oh boy, that is ugly. You should file a bug report for it. My first thought is that java.aw1.Dimension contains a typo ('1' instead of 't'), but others should have a look. Do you have Oracle JRE 7 update 45?

It would be a bit strange that LibreOffice for Windows and Mac to have different code bases, but it looks like they do.

bencomp gravatar imagebencomp ( 2014-01-06 00:46:49 +0100 )edit

You're right about my typo (the actual listing does say 't'). Will follow-up the existing bug report. Hope it gets fixed soon - we don't want Mac users being treated as second-class citizens!

frofa gravatar imagefrofa ( 2014-01-06 02:12:41 +0100 )edit

They already are second class citizens where LibreOffice is concerned.

Alex Thurgood gravatar imageAlex Thurgood ( 2014-08-11 10:17:35 +0100 )edit

Question Tools



Asked: 2014-01-05 20:45:43 +0100

Seen: 7,903 times

Last updated: Jan 05 '14