The following dataset is used in the example below that shows how to insert a picture into an ODT
report.
Insert a temporary picture in the template.
Write the marker {d.logo}
in the alternative text of the picture.
To access the alternative text on LibreOffice: Right-click the Image > Format... > Text Alternative.
This replaces the temporary picture by the one linked in the "logo" data. After the document is rendered, the new image from the URL appears on the report. It is also possible to display a list of pictures by writing a loop.
For this example, we set up a database in Ninox that contains a table like the one shown below. The flag preview is optional and is for illustration purposes.
[i+1]
on the second pictureThen, save the ODT
report in LibreOffice.
Click the plus icon to create a new layout. Select Dynamic, then click the Import icon. Select the ODT
report (here: Flag images report.odt
). Once the file is uploaded, click the Create button.
On the right side, toggle Custom JSON on. Then click the formula field under JSON data input. The formula editor opens.
Paste the #data, then click the Save button.
PDF
reportClick the Print icon and select This record to download a PDF
preview.
After the document is rendered, the list of images appears on the PDF
report: