This feature works with ODT
, ODS
, ODP
, ODG
, XLSX
, and DOCX
files.
If an error occurs for some reasons (fetch failed, image type not supported), a replacement error image is used.
The place to insert the marker on the temporary picture may change depends on the file format:
ODS
, ODP
and ODG
files: set the marker on the image title
ODT
file: set the marker on the image alternative text, image description
DOCX
and XLSX
files: set the marker either on the image title, image description, or alternative text
Accepted images types: .jpeg
, .png
, and .gif
. .svg
are working only for ODS
/ODT
reports.
it is not possible to create images loops in XLSX
, ODS
, and ODG
files, it produces an invalid report
for ODP
, it is not possible to create a loop of images inside a single slide, but it is possible to create images loops through 2 slides or more
The image anchor type changes the rendering behavior and particular cases are not valid.
To update the anchor type of an image on LibreOffice: Right-click the Image > Properties > Type > Anchor.
To update the position type of an image on Word: Double-left-click the Image > Picture Format tab > Position.
imageFit
formatterThis formatter works with ODT
and DOCX
files.
The imageFit
formatter sets how the image should be resized to fit its container. An argument has to be passed to the formatter:
fillWidth
: the replaced image is sized to fill the element’s content-box width
the aspect ratio does not change
contain
: the replaced image is scaled to maintain its aspect ratio while fitting within the element’s content-box (the temporary image)
fill
: the replaced image is sized to fill the element’s content-box (the temporary image)
the entire image will fill the box of the previous image
if the object's aspect ratio does not match the aspect ratio of its box, then the object will be stretched to fit
Anchor type | Print engine behavior |
---|---|
Position type | Print engine behavior |
---|---|
As character
Best choice: the replacement of a single image or a loop of images is possible.
To page To paragraph To character
The image is floating, it not possible to create a loop of images, only a single image replacement is accepted.
In line with text
Best choice: the replacement of a single image or a loop of images is possible.
With text wrapping
The image is floating, it not possible to create a loop of images, only a single image replacement is accepted.
This feature may not work at the time of release. Use Picture from a public URL in the meantime. We will update this page once it becomes available.
It is possible to provide a picture directly in the data field as a Base64 Data URIs like the example below.
In the data field, the first part of the Data URIs data:image/jpeg;base64
, has to be removed. Add the $
prefix in the data field.
Insert a temporary picture in the template.
Write the marker {d.dog}
in the alternative text of the picture.
To access the alternative text on LibreOffice: Right-click the Image > Format... > Text Alternative.
Base64 images can only be set only at the root of a JSON object, not in an array nor in a child object.
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:
This feature may not work at the time of release. Use Picture from a public URL in the meantime. We will update this page once it becomes available.
Before continuing, check out this documentation to learn more about Data URIs.
The following dataset is used in the example below that shows how to insert a picture into an ODS
report.
Insert a temporary picture in the template.
Write the marker {d.frenchFlagImage}
in the title picture property.
To access to the title on LibreOffice: Click the Image > Format... > Description > Title.
After the document is rendered, the new image from the data URI appears on the report.