Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
The following pages on print customization are copied and adapted from the original documentation of the third-party integration carbone.io.
Learn the basics of print customization in Ninox
Print customization is available for Private Cloud starting 3.7.7.
The pricing page (section on Essentials) offers info on how many renders per month are available in your subscription.
Any time a dynamic print layout is created (either with or without the use of a function), 1 render is dedicated from the monthly quota.
Ninox uses a third-party integration, carbone.io, to find all markers {}
in a document (.xlsx
, .odt
, .docx
, ...) and replace these markers with Ninox data.
According to the syntax of your markers, the following operations can be performed:
replacing a field
formatting data
repeating a document portion (a table row or anything else)
looping on unlimited nested arrays
conditionally displaying a data based on a test expression
The syntax is similar to using a JSON Array or Object in JavaScript. Combined with features of, for example, Microsoft Word or LibreOffice, you can create documents with:
graphics
headers, footers
automatically repeated table header across pages
insert computed field
page count
etc.
.xhtml
.odt
.ods
.odp
.docx
.xlsx
.pptx
.odg
.pdf
Google Fonts are pre-installed. If a font is not rendering into documents, verify that font is available on Google Fonts.
These functions work with the Blank and Auto print layout options.
printRecord(nid, layoutName)
prints default report
printAndSaveRecord(nid, layoutName)
prints default report and returns the link
These functions work only with the Dynamic print layout option.
printRecord(nid, templateLayoutName, data)
prints dynamic report with your custom layout
printAndSaveRecord(nid, templateLayoutName, data)
prints dynamic report with your custom layout and returns the link
Get from a document in a text editor to a printable report in Ninox
Open a text editor, e.g., Microsoft Word, LibreOffice, Open Office, Google Docs, or other.
Use your text editor's functionalities to add a header, a footer, pictures, or dynamic content with JSON data. Follow the links below to learn how to:
Save your template.
Preview the merged layout. If the document looks as expected, click the Print button, select All or This record to download the PDF
document.
Choose the type of template you want. Refer to .
insert data into a document ->
print a list of elements ->
format numbers, dates, and strings ->
show and hide content conditionally ->
The first step to creating and rendering a report is to set up a new print layout in Ninox.
Open a database to open a table that contains records you want to print.
Alternatively, open a database to open a view that references data from different tables or databases.
Open a record. The record view slides in from right-to-left.
Click the print icon from the toolbar on the right side of your screen. The print layout view opens.
Click the plus icon to create a new layout. The Create new layout popup appears.
Choose Dynamic, then click the Import layout icon.
When selected, the popup displays the name of the file. Click the Create button to finish merging data from your template.
Next, you have 2 options how to get from a template in a text editor to a rendered PDF in Ninox: Option A: without a custom script or Option B: with a custom script.
Without a custom script, your template (e.g., a DOCX
file) must follow the proper notation for field names.
Field names need to be written with CamelCase or using underscore _
. If you write a field name with any other characters, including white spaces, data for that field is not rendered.
Examples:
By default, the recursion level is set to a minimum of 3
. The recursion works as follows:
root record = 1
subtable in root = 2
another table within the subtable = 3
etc.
Either leave the recursion level set to its default or consider increasing the number of recursions, based on your needs.
LastName
last_name
Last_Name
last_Name
Last Name
last-name
If needed, encrypt a rendered report with a password.
Either toggle ON the option Set password in the Ninox UI, or alternatively use a custom script and the functions printRecord
or printAndSaveRecord
.
Works with printRecord and printAndSaveRecord.
The data
object can include the property _options
with pdfPassword
which overrides the default settings set by the print engine in the Ninox UI, if you previously toggled OFF Set password.
An empty password like""
will not encrypt your report.
Add a new layout element, here: a button.
Paste the script below in the formula editor.
Save changes.
Click or tap the button to run the script.
A report (PDF file) is created and downloaded to your local files. When you open the PDF from your browser, you are prompted to enter a password to open the document.
To substitute data in a template, use indicators {d.}
. Indicators {d.}
are substituted for data from your JSON dataset in Ninox.
The following values can be substituted:
a string
a number
a date
Use the sample data below to understand how to get from a document (= template, here: DOCX
in Microsoft Word) to a rendered report (= result, PDF
in Ninox).
Create a database from the NINOX
backup file from the sample data below.
Once the database is created, open the Invoice table, click any record, then click the Print icon.
View the 2 layouts:
en_invoice_template -> refer to#option-a-without-a-custom-script
en_invoice_template_without_JSON -> refer to #option-b-with-a-custom-script
Open Microsoft Word or another text editor to view the MS Word template A (Option A) and B (Option B).
Depending on which template is used, you either work with or without a custom script.
In Ninox, select a layout, then click the Print icon. Select This record to download the final result, a rendered PDF
report.
Note: For both layouts, we use a global function to correctly display currency.
Download and print a test PDF to verify that the rendered report contains the desired data and looks as expected in your layout.
The test print contains a watermark. The proof print contains a watermark. The final, "real" print will not have a watermark.
Either toggle ON the option Test print in the Ninox UI, or alternatively use a custom script and the functions printRecord
or printAndSaveRecord
.
The data
object can include the property _options
with testPrint
which overrides the default settings set by the print engine in the Ninox UI, i.e., if you previously toggled OFF Test print.
Add a new layout element, here: a button.
Paste the script below in the formula editor.
Save changes.
Click or tap the button to run the script.
A report (PDF file) is created and downloaded to your local files.
Both MS Word templates A and B result in the same report. All roads lead to Rome.
What | File format | EN | DE | Notes |
---|---|---|---|---|
Using data from , view the files below: a test print with a watermark and a final print without a watermark.
Works with and .
MS Word template A
DOCX
no custom script needed, refer to Option A: without a custom script
MS Word template B
DOCX
requires custom script, refer to Option B: with a custom script
rendered report
PDF
watermark on PDF only appears in this demo
database
NINOX
custom script
JSON
global function
JSON
When data is an array of objects, access each object directly using the square bracket notation []
and the reserved word i
, which represents the ith
item of the array.
Zero-based arrays are used:
the first item of an array is [i=0]
or [0]
,
the second item of an array is [i=1]
or [1]
,
etc.
My preferred movie is {d[i=1].movie}
My preferred movie is Matrix
Use aliases to simplify the maintenance of your report avoiding code repetition or to insert markers somewhere in the document where special characters like square brackets []
are not allowed, e.g., in worksheet names.
Aliases can be used to:
write {#... = ...}
to define an alias
write {$...}
to use this alias
Define aliases anywhere in the document, at the end, or at the beginning. Aliases are parsed and removed automatically before rendering.
{#myAlias = d.wheels}
{d.name} need {$myAlias} wheels!
Cars need 4 wheels!
To repeat a section of a document, for example rows, title, or pages, use a "repetition example" with the reserved key word i
and i+1
.
It's not necessary to define where the repetition starts and ends.
The pattern is automatically found and repeated using the first row (i
) as an example. The second row (i+1
) is removed before rendering the result.
Cars |
---|
Cars |
---|
{d.cars[i].brand}
{d.cars[i+1].brand}
Lumeneo
Tesla
Toyota
Use conditional operators to filter arrays: >
, <
, >=
, <=
, =
, !=
.
Filters should be the same on the ith+1
marker and all other markers if you want to keep only matching rows. Use an Alias to simplify report maintenance.
Filter with strings as shown in the example below.
Filter the loop index as shown in the example below.
Repeat nested arrays are managed at unlimited depth. The following example shows a repetition of a whole document.
It is not necessary to completely repeat the first paragraph twice in the template—repeat only the title of the second paragraph to detect where the repetition pattern of the main array ends {d.cars[i+1].brand}
.
The bi-directional loop performs iterations in 2 directions, creating additional columns and rows.
The feature depends significantly on the XML coming from the document.
If the table is badly formed, there may be issues recognizing the elements to repeat, which in turn may create a corrupted document.
People |
---|
People |
---|
People |
---|
People |
---|
People |
---|
People |
---|
Models |
---|
Models |
---|
Models |
---|
{d[i].models[i].brand} | {d[i+1].models[i].brand} |
---|
Toyota | Tesla | Lumeneo |
---|
Cars |
---|
Cars |
---|
Vehicles |
---|
Vehicles |
---|
In the , only distinct rows are kept.
Cars |
---|
Vehicles |
---|
{d[i , age > 19, age < 30].name}
{d[i+1, age > 19, age < 30].name}
John
Bob
{d[i , type='rocket'].name}
{d[i+1, type='rocket'].name}
Falcon 9
Falcon Heavy
{d[i, i < 2].name}
{d[i+1, i < 2].name}
Falcon 9
Model S
|
|
Prius 2 |
Prius 3 |
S |
X |
|
|
|
|
Prius 2 | S | Smera |
Prius 3 | X | Néoma |
|
|
Tesla |
Toyota |
Lumeneo |
|
|
Tesla |
Airbus |
|
|
Tesla |
Toyota |
Airbus |
Boeing |
Access the iterator value when a list is printed into a document.
In {d[i].cars[i].other.wheels[i].tire.subObject:add(.i):add(..i):add(...i)}
The number of dots equals the number of previous i
:
.i
matches the index value of wheels[i]
..i
matches the index value of cars[i]
...i
matches the index value of d[i]
All existing formatters by input data type
Formatters translate raw data into human readable text.
To apply a formatter to data, use the separator :
. Multiple formatters can be used one after another. Each formatter input is the output of the previous one. Some formatters accept static or Dynamic parameters.
The example below shows how to write "John"
instead of "JOHN"
using 2 chained formatters, and how to translate a raw ISO date into a human readable date.
My name is {d.name:lowerCase:ucFirst}.
I was born on {d.birthday:convDate(YYYY-MM-DD, LL)}.
My name is John.
I was born on Monday 31th 2000.
People name | People age |
---|---|
People name | People age |
---|---|
{d.myObject[i].att}
{d.myObject[i].val}
{d.myObject[i+1].att}
{d.myObject[i+1].val}
paul
10
jack
20
bob
30
Formatters can be chained with dynamic parameters to create complex operations, check out the example in Dynamic parameters.
converts from one currency to another
exchange rates are included by default
you can provide a new exchange rate for one report in options.currencyRates
of Carbone.render
or globally with Carbone.set
convCurr()
without parameters converts automatically from options.currencySource
to options.currencyTarget
rounds a number
same as toFixed()
but it rounds number correctly round(1.05, 1) = 1.1
formats number according to the locale
applying a number of decimals depends on the report type:
for ODS
/XLSX
, the number of decimals has to be formatted based on the text editor
for the other type of files, the number of decimals depends on the precision
parameter passed to the formatter
Adds 2 numbers.
Subtracts 2 numbers.
Multiplies 2 numbers.
Divides 2 numbers.
Converts a number to an INT.
Converts a number with English specifications (decimal separator is a dot .
).
Converts a number into string, keeping only decimals.
Converts a number with French specifications (decimal separator is a comma ,
).
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
target
[optional] convert to this currency ('EUR')
by default it equals options.currencyTarget
string
source
[optional] currency of source data ('USD')
by default it equals options.currencySource
string
precision
number of decimal
number
precision
[optional] number of decimals
number
precisionOrFormat
[optional] number of decimal, or specific format
integer : change default precision of the currency
M : print major currency name without the number
L : prints number with currency symbol (by default)
LL : prints number with major currency name
number
An aggregate formatter calculates a set of values and returns a single value. For example, the average :aggAvg
takes a list of values and returns the average.
The following aggregators are available:
aggSum returns the sum of all values in a set.
aggAvg returns the average of a set.
aggMin returns the minimum value in a set.
aggMax returns the maximum value in a set.
aggCount returns the number of items in a set.
aggCumSum the cumulative sums, also known as running totals, returns the total sum of data as it grows with series.
Aggregators can be printed as standalone expressions or can be part of loops to compute custom grouping clauses, e.g., sub-totals, cumulative totals.
Returns the sum of all values in a set.
Data
Total:
{d.cars[].qty:aggSum}
Total by sorting "sort" values above 1:
{d.cars[sort>1].qty:aggSum}
Total by multiplying the "qty" by the "sort" attribute:
{d.cars[sort>1].qty:mul(.sort):aggSum:formatC}
Total:
21
Total by sorting "sort" values above 1:
19
Total by multiplying the "qty" by the "sort" attribute:
81
The aggSum
aggregator can be used within loops, for instance:
sum-up people's salaries by departments:
{d.departments[i].people[].salary:aggSum}
{d.departments[i].people[].salary:aggSum(.i)}
(alternative)
global sum of all departments, all people's salary:
{d.departments[i].people[i].salary:aggSum}
{d.departments[i].people[i].salary:aggSum(0)}
(alternative)
Change the partition with dynamic parameters:
sum salaries by people by age, regardless of departments
{d.departments[i].people[i].salary:aggSum(.age)}
sum salaries by people by age and gender, regardless of departments
{d.departments[i].people[i].salary:aggSum(.age, .gender)}
Lower case all letters.
Upper case all letters.
Upper case first letter.
Upper case the first letter of all words.
"catch all formatter"
always returns the same message if called
converts user-defined enums to human readable values
user-defined enums must be passed in options
of carbone.render
Removes accents from text.
Renders carriage return \r
and line feed into documents instead of printing them as a string.
supported file formats: DOCX
, PDF
, ODT
, ODS
ODS
support is experimental
use the :convCRLF
formatter before :html
to convert to <br>
tags
example: {d.content:convCRLF:html}
Slices a string with a begin and an end.
Pads the string from the start with another string.
Pads the string from the end with another string.
Returns the length of a string or array.
No formatters can be chained after hideBegin
, hideEnd
, showBegin
, showEnd
.
By default, condition formatters have a special behavior, the formatter's result is not propagated to the next formatter if the result of the condition is true. This enables test chaining with Dynamic parameters.
Hide and show a part of the document with the following formatters:
hideBegin
/ hideEnd
: hide text block between hideBegin
and hideEnd
if condition is true.
showBegin
/ showEnd
: show a text block between showBegin and showEnd if condition is true.
ifEQ (value)
: Matches values that are equal to a specified value.
ifNE (value)
: Matches all values that are not equal to a specified value.
ifGT (value)
: Matches values that are greater than a specified value.
ifGTE (value)
: Matches values that are greater than or equal to a specified value.
ifLT (value)
: Matches values that are less than a specified value.
ifLTE (value)
: Matches values that are less than or equal to a specified value.
ifIN (value)
: Matches any of the values specified in an array or string.
ifNIN (value)
: Matches none of the values specified in an array or string
ifEM ()
: Matches empty values, string, arrays or objects.
ifNEM ()
: Matches not empty values, string, arrays or objects.
and (value)
: AND
operator between two consecutive conditional formatters.
or (value)
: (default) OR
operator between 2 consecutive conditional formatters.
show (message)
: print a message if a condition is true.
elseShow (message)
: print a message if a condition is false.
Data
one = { d.status1:ifEQ(2):show(two):or(.status1):ifEQ(1):show(one):elseShow(unknown) }
two = { d.status2:ifEQ(2):show(two):or(.status2):ifEQ(1):show(one):elseShow(unknown) }
three = { d.status3:ifEQ(2):show(two):or(.status3):ifEQ(1):show(one):elseShow(unknown) }
one = "one"
two = "two"
three = "unknown"
Supported file formats: DOCX
, ODT
, and PDF
.
when you use the drop
formatter, the tag value is not printed and chained formatters are not executed
to drop a group of elements, use #hidebegin-hideend or #showbegin-showend
use the drop
formatter to delete elements from a document. The first argument passed to :drop(argument1)
is the element to drop
p
to drop paragraphs
usage: {d.text:ifEM:drop(p)}
include the tag within a paragraph, and all the elements it comprises are also removed if the condition is validated (external help page)
row
to drop table rows
usage: {d.data:ifEM:drop(row)}
include the tag in a table row, and all the elements it comprises are also deleted if the condition is validated (external help page)
Optionally, use nbrRowsToHide
to set the number of rows to drop as a second argument {d.data:ifEM:drop(row, nbrRowsToHide)}
, such as {d.data:ifEM:drop(row, 3)}
, meaning the current and next two rows is removed if the condition is validated.
By default, the formatter :drop(row)
hides only the current row.
img
to drop pictures
usage: {d.img:ifEM:drop(img)}
include the tag within the image title, description, or alternative text (external help page)
chart
to drop charts
usage: {d.dataset:ifEM:drop(chart)}
include the tag within the alternative text of the graphic (external help page)
shape
to drop shape (square, circle, arrows, etc.)
usage: {d.dataset:ifEM:drop(chart)}
include the tag within the title, description or alternative text of the shape (external help page)
Shows a text block between showBegin
and showEnd
if a condition is true.
Use only break lines (shift
+ Enter
) between showBegin
and showEnd
.
Learn more about why conditional formatters are adding empty lines.
Data
Banana{d.toBuy:ifEQ(true):showBegin} Apple Pineapple {d.toBuy:showEnd}grapes
Banana Apple Pineapple grapes
Hides a text block between hideBegin
and hideEnd
if a condition is true.
Use only break lines (shift
+ Enter
) between hideBegin
and hideEnd
. Learn more about why conditional formatters are adding empty lines.
Data
Banana{d.toBuy:ifEQ(true):hideBegin} Apple Pineapple {d.toBuy:hideEnd}grapes
Banana grapes
Changes the default operator between conditional formatters.
{d.car:ifEQ('delorean'):and(.speed):ifGT(80):show('TravelInTime'):elseShow('StayHere')}
means "if d.car equals 'delorean' AND d.speed is greater than 80, then it prints 'TravelInTime', otherwise it prints 'StayHere'
Changes the default operator between conditional formatters.
{d.car:ifEQ('delorean'):or(.speed):ifGT(80):show('TravelInTime'):elseShow('StayHere')}
means "if d.car equals 'delorean' OR d.speed is greater than 80, then it prints 'TravelInTime', otherwise
it prints 'StayHere'
Matches empty values, string, arrays or objects (null, undefined, [], {}, ...).
Matches not empty values, string, arrays or objects.
matches all values that are equal to a specified value
can be combined with other formatters to create conditional content
returns the initial marker
the state of the condition is not returned
matches all values that are not equal to a specified value
can be combined with other formatters to create conditional content
returns the initial marker
the state of the condition is not returned
Matches values that are greater than a specified value.
Matches values that are greater than or equal to a specified value.
Matches values that are less than a specified value.
Matches values that are less than or equal to a specified value.
Matches any of the values specified in an array or string.
Matches none of the values specified in an array or string.
prints a message if the condition is true
use with other formatters to print conditional content
print a message if the condition is false
use with other formatters to print conditional content
To get the current date in UTC, use the marker {c.now}
in your template. The current date in UTC is returned only if the complement object option.complement
is not overwritten by custom data.
formats dates
takes an output date pattern as an argument
date patterns are available in #date-formats
change the timezone
through the option options.timezone
and the lang
through options.lang
timezones (Wikipedia)
Formats intervals/duration.
human+
human
millisecond(s)
or ms
second(s)
or s
minute(s)
or m
hour(s)
or h
year(s)
or y
month(s)
or M
week(s)
or w
day(s)
or d
adds a time to a date
available units: day, week, month, quarter, year, hour, minute, second and millisecond
units are case insensitive, and support plural and short forms
subtracts a time to a date
available units: day, week, month, quarter, year, hour, minute, second and millisecond
units are case insensitive, and support plural and short forms
Creates a date and set it to the start of a unit of time.
Creates a date and set it to the end of a unit of time.
Because preferred formatting differs based on language, there are a few tokens that can be used to format a date based on report language.
There are upper and lower case variations on the same formats. The lowercase version is intended to be the shortened version of its uppercase counterpart.
Returns the maximum value in a set.
Maximum quantity:
{d.cars[].qty:aggMax}
Maximum quantity by sorting "sort" values above 1:
{d.cars[sort>1].qty:aggMax}
Maximum quantity by multiplying the "qty" by the "sort" attribute:
{d.cars[sort>1].qty:mul(.sort):aggMax:formatC}
Maximum quantity:
10
Maximum quantity by sorting "sort" values above 1:
10
Maximum quantity by multiplying the "qty" by the "sort" attribute:
50
Returns the average of a set.
Average quantity:
{d.cars[].qty:aggAvg}
Average quantity by sorting "sort" values above 1:
{d.cars[sort>1].qty:aggAvg}
Average quantity by multiplying the "qty" by the "sort" attribute:
{d.cars[sort>1].qty:mul(.sort):aggAvg:formatC}
Average quantity:
3.5
Average quantity by sorting "sort" values above 1:
4.75
Average quantity by multiplying the "qty" by the "sort" attribute:
13.50
Returns the minimum value in a set.
Minimum quantity:
{d.cars[].qty:aggMin}
Minimum quantity by sorting "sort" values above 1:
{d.cars[sort>1].qty:aggMin}
Minimum quantity by multiplying the "qty" by the "sort" attribute:
{d.cars[sort>1].qty:mul(.sort):aggMin:formatC}
Minimum quantity:
1
Minimum quantity by sorting "sort" values above 1:
2
Minimum quantity by multiplying the "qty" by the "sort" attribute:
4
Returns the number of items in a set.
Count quantity items:
{d.cars[].qty:aggCount}
Count quantity items by sorting "sort" values above 1:
{d.cars[sort>1].qty:aggCount}
Count quantity items by multiplying the "qty" by the "sort" attribute:
{d.cars[sort>1].qty:mul(.sort):aggCount:formatC}
Count quantity items:
10
Count quantity items by sorting "sort" values above 1:
10
Count quantity items by multiplying the "qty" by the "sort" attribute:
50
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
params | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Format | Output | Description |
---|---|---|
Format | English locale | Sample output |
---|---|---|
message
text to print
string
type
enum name passed in options
of carbone.render(data, options)
string
begin
Zero-based index at which to begin extraction.
integer
end
Zero-based index before which to end extraction
integer
targetLength
The length of the resulting string once the string has been padded. If the value is less than string length, then string is returned as-is.
number
padString
The string to pad the current str with. If padString is too long to stay within the targetLength, it will be truncated from the end. The default value is " "
string
targetLength
The length of the resulting string once the string has been padded. If the value is less than string length, then string is returned as-is.
number
padString
The string to pad the current str with. If padString is too long to stay within the targetLength, it will be truncated from the end. The default value is " "
string
value
[optional] new value to test
mixed
value
[optional] new value to test
mixed
value
value to test
string, integer
value
value to test
string, integer
value
value to test
integer
value
value to test
integer
value
value to test
integer
value
value to test
integer
value
value to test
integer
value
value to test
integer
message
message to print
message
message to print
patternOut
output format
string
patternIn
[optional] input format
ISO 8601 by default
string
patternOut
output format: human, human+, milliseconds, seconds,...
string
patternIn
[optional] input unit: milliseconds, seconds,...
string
amount
the amount
number
unit
the unit
string
patternIn
[optional] input format
ISO8601 by default
string
amount
the amount
number
unit
the unit
string
patternIn
[optional] input format
ISO8601 by default
string
unit
the unit
string
patternIn
[optional] input format
ISO8601 by default
string
unit
the unit
string
patternIn
[optional] input format
ISO8601 by default
string
patternIn
input format
string
patternOut
output format
string
X
1360013296
Unix Timestamp
x
1360013296123
Unix Millisecond Timestamp
YY
18
Two-digit year
YYYY
2018
Four-digit year
M
1-12
The month, beginning at 1
MM
01-12
The month, 2-digits
MMM
Jan-Dec
The abbreviated month name
MMMM
January-December
The full month name
D
1-31
The day of the month
DD
01-31
The day of the month, 2-digits
d
0-6
The day of the week, with Sunday as 0
dd
Su-Sa
The min name of the day of the week
ddd
Sun-Sat
The short name of the day of the week
dddd
Sunday-Saturday
The name of the day of the week
H
0-23
The hour
HH
00-23
The hour, 2-digits
h
1-12
The hour, 12-hour clock
hh
01-12
The hour, 12-hour clock, 2-digits
m
0-59
The minute
mm
00-59
The minute, 2-digits
s
0-59
The second
ss
00-59
The second, 2-digits
SSS
000-999
The millisecond, 3-digits
Z
+05:00
The offset from UTC, ±HH:mm
ZZ
+0500
The offset from UTC, ±HHmm
A
AM PM
a
am pm
LT
h:mm A
8:02 PM
LTS
h:mm:ss A
8:02:18 PM
L
MM/DD/YYYY
08/16/2018
LL
MMMM D, YYYY
August 16, 2018
LLL
MMMM D, YYYY h:mm A
August 16, 2018 8:02 PM
LLLL
dddd, MMMM D, YYYY h:mm A
Thursday, August 16, 2018 8:02 PM
l
M/D/YYYY
8/16/2018
ll
MMM D, YYYY
Aug 16, 2018
lll
MMM D, YYYY h:mm A
Aug 16, 2018 8:02 PM
llll
ddd, MMM D, YYYY h:mm A
Thu, Aug 16, 2018 8:02 PM
Generate dynamic charts into documents with 2 solutions:
native charts of Microsoft Word or LibreOffice: design and configure visualizations from your text editor
ECharts 5 charts as images: design and configure visualizations from your JSON data set
Apply colors dynamically on elements with the bindColor
marker.
The bindColor
marker is supported on:
text and background colors
table cells background
shapes backgrounds and lines colors for DOCX
files only
Shapes background and lines colors in DOCX
write the bindColor
marker in the document body, not in the alternative text of shapes
the replaced color format must be solely RGB
A bindColor
marker replaces a color reference on the template with a new color coming from your JSON dataset in Ninox.
myColorToBind
a temporary hexadecimal color applied to a text, background or a cell background
used to identify the color to replace
the hexadecimal is case insensitive and the hashtag at the beginning is optional
In Microsoft Word, only a color name can be used to replace the background color of a text. Learn more about the Microsoft Word exception.
myFormat
the new color format expected from the marker myVar
available Color formats
myVar
The marker that corresponds to the new color.
Learn how to create line charts in DOCX/PDF documents in Microsoft Word
The dataset below is used in a chart that represents the weather temperature during a short period.
Group temperatures history by dates (minimum, maximum, average) using the following dataset:
DOCX
template in Microsoft WordClick the Insert tab > Chart menu > Line > 2D Line to insert a line chart.
As soon as the chart is created, Microsoft Word opens an Excel spreadsheet to edit charts values.
Delete default values, and insert temperature values by looping through the temps
list.
After each loop expression that contains [i]
in the first row, use the expression [i+1]
in the next line.
Dynamic charts do not support only one [i+1]
for multiple [i]
expressions.
Generate the PDF
report, and the line chart is automatically filled.
Create pie charts in ODT documents in LibreOffice
The dataset below is used in a chart that represents the quantity of cheese purchased by french households in 2019.
Group values by cheese types using the following dataset:
ODT
template in LibreOfficeClick the Home tab > Chart button. A column chart appears. Change the chart format by clicking the chart type button from the chart toolbar.
Insert the data dynamically using a loop
and the bindChart
formatter: Click Data Table from the chart toolbar. A popup appears to edit chart values.
The following is not different than Microsoft Word. It's not possible to insert tag {d.value}
inside table cells, except in the first column Categories
.
So you write the category name, then add bindChart
tags. The {bindChart}
formatter is used to bind a variable to a reference tag in the table cell, i.e., "the value X
in the chart must be replaced by the tag Y
."
jn the first cell, the following expression is written: {d.cheeses[i].type} {bindChart(3)=d.cheeses[i].purchasedTonnes}
the cheese type is printed with {d.cheeses[i].type}
, then bindChart
is used to bind the variable d.cheeses[i].purchasedTonnes
to the cell that has the value 3
this means: the purchasedTonnes
value is printed instead of 3
in the first cell of the second row, the expression {d.cheeses[i+1].type} {bindChart(4)=d.cheeses[i+1].purchasedTonnes}
is written
the bindChart
replaces the 4
value by the d.cheeses[i+1].purchasedTonnes
variable
Generate the PDF
report, and the pie chart is automatically filled.
Native charts define how to create graphical visualizations from numerical data within your text editor. The format defines:
the dataset to be used for the visual display and
several different types of graphical displays
such as line charts, pie charts, etc.
The following 2 docs contain examples how to create a pie chart within an ODT
document and a line chart within a DOCX
/PDF
document, respectively:
learn more in Create dynamic reports in LibreOffice
Provide the chart configuration within a JSON dataset. The dataset should include:
the chart format
numerical values
extra options
After configuring, the chart is injected as an SVG
image into the document. Refer to the Apache ECharts library for more details.
supported file formats: PDF
, ODT
, ODS
, ODP
, ODG
, DOCX
, XLSX
In a template, insert a picture as a reference slot.
Place a tag in the alternative text of the picture {d.chartOptions:chart}
with the formatter :chart
. Without :chart
, the attribute {d.chartOptions}
is considered as an image.
Design your JSON dataset by adding an object named chartOptions
. The object must contain ECharts options and your data.
Use the following configuration for a line chart:
Generate the PDF
report.
Build any type of chart, following the documentation below:
Manage
: get #00FFFF
reference color, to be replaced by #FF0000
coming from the {d.color}
marker
dynamic
: get #FF00FF
reference color, to be replaced by #00FF00
coming from the {d.color2}
marker
color
: get #0000FF
reference color in the background, to be replaced by #00FF00
coming from the {d.color3}
marker
In Microsoft Word, only a color name can be used to replace the background color of a text.
You can still use hexadecimal colors for the text and cells backgrounds in Microsoft Word.
Microsoft
: get the red
background color
Word
: get the magenta
background color
the background: get the #FFFF00
background color
supported file formats: DOCX
, ODT
, PDF
. DOCX
/ODT
templates can generate DOCX
/ODT
/PDF
documents
create charts only from your text editor (Microsoft Word or LibreOffice); insert the data series in the XLSX
/ODS
sheet provided by your text editor
charts cannot be copy-pasted from an external XLSX
/ODS
file
external spreadsheets cannot be linked as dynamic series of data
in LibreOffice, the {bindChart()}
tag is required
chart styling (titles, colors, captions, etc.) can only be defined within the text editor
styling from a JSON dataset cannot be edited, unlike ECharts 5 charts
Format | Types | Supported |
---|---|---|
Format | Types | Supported |
---|---|---|
ODT
to DOCX
/ODT
/PDF
or ODS
to XLSX
/ODS
/PDF
DOCX
to DOCX
/ODT
/PDF
or XLSX
to XLSX
/ODS
/PDF
with the option "hardRefresh": true
, such as { "convertTo": "docx", "hardRefresh": true }
DOCX
to DOCX
or XLSX
to XLSX
without the option "hardRefresh": true
translations are supported: cs
, de
, en
, es
, fi
, fr
, it
, ja
, ko
, pl
, pt-br
, ro
, ru
, si
, th
, zh
chart configuration doesn't support external dependencies (maps, JS scripts)
chart styling (titles, colors, captions, etc.) can only be defined within the JSON dataset
the generated chart is an image, so it's not possible to edit the styling within the template, unlike Native charts
2D/3D Column
clustured
, stacked
, percent stacked
2D/3D Bar
clustured
, stacked
, percent stacked
2D/3D Line
line
, stacked
, percent stacked
, line with markers
, stacked line with markers
, percent stacked line with markers
2D/3D Area
area
, stacked
, percent stacked
2D/3D Pie
pie
2D/3D Pie
pie of pie
, bar of pie
Doughtnut
Doughtnut
Combo
Clustured Column/Line
, Stacked Area
Hierarchi
sunburst chart
, treemap chart
Statistical
histogram
, box and whisker
Waterfall
waterfall
, funnel
, stock
, surface
, radar
Scatter
scatter
, bubbles
Map
Map
Column
normal
, stacked
, percent stacked
Bar
normal
, stacked
, percent stacked
Pie
normal
, exploded
, donut
, exploded donut
Area
normal
, stacked
, percent stacked
Line
point only
, points and lines
, lines only
, 3D Lines
Scatter
point only
, points and lines
, lines only
, 3D Lines
Net
point only
, points and lines
, lines only
, Filled
Column and Line
normal
, stacked
Stock
1
, 2
, 3
, 4
Bubble
normal
Each line in a table can be colorized by one color:
first line: get #0000FF
color
second line: get #00FFFF
color
each line: get the color corresponding to the color key in each user object
The first line get the #0000FF
color and the second line get the #00FFFF
color. Each line get the color corresponding to the color key in each user object.
If a dynamic hyperlink or a HTML anchor tag is injected into a report and the URL verification fails, the formatter :defaultURL
can be used to replace the default error URL.
If the provided URL is not valid, it is replaced by https://carbone.io/documentation.html#hyperlink-validation
.
When inserting dynamic hyperlinks, chain the :defaultURL
formatter to the marker, such as:
It is possible to pass another marker as an argument:
When using the :html
formatter, place the :defaultURL
before:
Hyperlinks can be applied dynamically to elements (texts, images, tables, list) for DOCX
, ODT
, ODS
, and XLSX
documents. Right-click the element and select "hyperlinks" to insert the marker.
example: reduce {d.url}
to d.url
; if http://
appears before d.url
, the hyperlink works
Before injecting hyperlinks dynamically on reports, the URL is verified whether it has a valid format.
If the provided URL is not valid, it is replaced by https://carbone.io/documentation.html#hyperlink-validation
.
expected behavior: text editor automatically replaces curly braces with special characters: %256B
a static URL and a URL coming from a marker, e.g., https://carbone.io{d.url}
, cannot be inserted together
https://carbone.io
is removed automatically and only {d.url}
is kept
do not write the marker with curly braces in XLSX
files
required: a root domain of length between 2 and 256
required: a top level domain like .com
, .org
, .fr
, or other
optional: a protocol, either http://
or https://
. If it doesn't exist the protocol https://
is added
Generate barcodes as image following the same logic as for Pictures:
Insert a temporary picture in your template (white JPEG
image, or cat PNG
image). The temporary image is used to find the location to insert the barcode.
Write the marker followed by the barcode formatter into the alternative text, description, or title of the image. The format should be: {d.value:barcode(type)}
. Refer to Pictures for more info.
Insert the type
of barcode as a first argument of the formatter :barcode
. Refer to the#list-of-supported-barcodes below.
Generate the document.
Barcode options are available and can be passed to the barcode
formatter as a second argument, such as :barcode(type, options1, options2, ...)
. Refer to the #list-of-barcodes-options below.
This example shows how to insert 3 barcodes as images:
ean13
qrcode
gs1
Retrieve your barcode data as JSON
from your database.
Edit your template in a text editor, insert 3 temporary images. For each image, write as an alternative text tags:
First image: {d.urlQrCode:barcode(qrcode)}
Second image: {d.productCodeBarEan13:barcode(ean13)}
Third image: {d.productGs1:barcode(gs1-128)}
To scale the barcode, chain the formatter :imageFit
, such as {d.urlQrCode:barcode(qrcode):imageFit(contain)}
. Learn more about the #imagefit-formatter.
Pass the option as a second argument in any order. The option must keep the format "optionName:value", such as {d.number:barcode(qrcode, width:300, height:100, includetext:false, scale:1)}
.
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
Barcode name | Type |
---|---|
Option name | Type | Description |
---|---|---|
107 industry-standard barcode formats are supported for PDF
, DOCX
, ODT
, XLSX
, ODS
, ODP
, and ODG
documents.
the recommended solution to generate industry-standard barcodes
as font: not recommended to use, and only 4 barcodes are supported
Parameters | Description | Type |
---|
Anchor type | Print engine behavior |
---|
Position type | Print engine behavior |
---|
EAN-5 (5 digit add-on)
ean5
EAN-2 (2 digit add-on)
ean2
EAN-13
ean13
EAN-8
ean8
UPC-A
upca
UPC-E
upce
ISBN
isbn
ISMN
ismn
ISSN
issn
Code 128
code128
GS1-128
gs1-128
GS1-14
ean14
SSCC-18
sscc18
Code 39
code39
Code 39 Extended
code39ext
Italian Pharmacode
code32
Pharmazentralnummer (PZN)
pzn
Code 93
code93
Code 93 Extended
code93ext
Interleaved 2 of 5 (ITF)
interleaved2of5
ITF-14
itf14
Deutsche Post Identcode
identcode
Deutsche Post Leitcode
leitcode
GS1 DataBar Omnidirectional
databaromni
GS1 DataBar Stacked
databarstacked
GS1 DataBar Stacked Omnidirectional
databarstackedomni
GS1 DataBar Truncated
databartruncated
GS1 DataBar Limited
databarlimited
GS1 DataBar Expanded
databarexpanded
GS1 DataBar Expanded Stacked
databarexpandedstacked
GS1 North American Coupon
gs1northamericancoupon
Pharmaceutical Binary Code
pharmacode
Two-track Pharmacode
pharmacode2
Code 25
code2of5
Industrial 2 of 5
industrial2of5
IATA 2 of 5
iata2of5
Matrix 2 of 5
matrix2of5
COOP 2 of 5
coop2of5
Datalogic 2 of 5
datalogic2of5
Code 11
code11
BC412
bc412
Codabar
rationalizedCodabar
USPS Intelligent Mail
onecode
USPS POSTNET
postnet
USPS PLANET
planet
Royal Mail 4 State Customer Code
royalmail
AusPost 4 State Customer Code
auspost
Royal Dutch TPG Post KIX
kix
Japan Post 4 State Customer Code
japanpost
MSI Modified Plessey
msi
Plessey UK
plessey
Telepen
telepen
Telepen Numeric
telepennumeric
PosiCode
posicode
Codablock F
codablockf
Code 16K
code16k
Code 49
code49
Channel Code
channelcode
Flattermarken
flattermarken
Custom 1D symbology
raw
Custom 4 state symbology
daft
Miscellaneous symbols
symbol
PDF417
pdf417
Compact PDF417
pdf417compact
MicroPDF417
micropdf417
Data Matrix
datamatrix
Data Matrix Rectangular
datamatrixrectangular
Data Matrix Rectangular Extension
datamatrixrectangularextension
Royal Mail Mailmark
mailmark
QR Code
qrcode
Swiss QR Code
swissqrcode
Micro QR Code
microqrcode
Rectangular Micro QR Code
rectangularmicroqrcode
MaxiCode
maxicode
Aztec Code
azteccode
Compact Aztec Code
azteccodecompact
Aztec Runes
aztecrune
Code One
codeone
Han Xin Code
hanxin
DotCode
dotcode
Ultracode
ultracode
GS1 Composite 2D Component
gs1-cc
EAN-13 Composite
ean13composite
EAN-8 Composite
ean8composite
UPC-A Composite
upcacomposite
UPC-E Composite
upcecomposite
GS1 DataBar Omnidirectional Composite
databaromnicomposite
GS1 DataBar Stacked Composite
databarstackedcomposite
GS1 DataBar Stacked Omnidirectional Composite
databarstackedomnicomposite
GS1 DataBar Truncated Composite
databartruncatedcomposite
GS1 DataBar Limited Composite
databarlimitedcomposite
GS1 DataBar Expanded Composite
databarexpandedcomposite
GS1 DataBar Expanded Stacked Composite
databarexpandedstackedcomposite
GS1-128 Composite
gs1-128composite
GS1 Data Matrix
gs1datamatrix
GS1 Data Matrix Rectangular
gs1datamatrixrectangular
GS1 QR Code
gs1qrcode
GS1 DotCode
gs1dotcode
HIBC Code 39
hibccode39
HIBC Code 128
hibccode128
HIBC Data Matrix
hibcdatamatrix
HIBC Data Matrix Rectangular
hibcdatamatrixrectangular
HIBC PDF417
hibcpdf417
HIBC MicroPDF417
hibcmicropdf417
HIBC QR Code
hibcqrcode
HIBC Codablock F
hibccodablockf
HIBC Aztec Code
hibcazteccode
width
integer
Width a number as millimeters.
Example: {d.number:barcode(qrcode, width:300)}
. To scale the barcode, it is possible to chain the formatter :imageFit
, such as: {d.number:barcode(qrcode, width:300):imageFit(contain)}
.
height
integer
Height a number as millimeters.
Example: {d.number:barcode(qrcode, height:10)}
. To scale the barcode, it is possible to chain the formatter :imageFit
, such as: {d.urlQrCode:barcode(qrcode, height:10):imageFit(contain)}
.
scale
integer
Quality of the barcode as a number between 1
to 10
. It multiplies the width and height, creating a bigger resolution barcode. Example: {d.number:barcode(qrcode, scale:3)}
includetext
boolean
Show the text and takes a Boolean as value, true
or false
.
Example: {d.number:barcode(qrcode, includetext:false)}
textsize
integer
Change the text size. Example: {d.number:barcode(qrcode, textsize:20)}
textxalign
string
Change the alignment of the text horizontally. Takes only 4 values: left
, center
, right
, or justify
. The default value is center. Example: {d.number:barcode(qrcode, textxalign:right)}
textyalign
string
Change the alignment of the text vertically. Takes only 3 values: below
, center
, or above
. The default value is below.
Example: {d.number:barcode(qrcode, textyalign:above)}
rotate
string
Rotate the barcode and the text. Takes only 4 values (case insensitive): N
for not rotated, R
for 90 degree right rotation, L
for 90 degree left rotation, I
of 180 degree rotation. Example: {d.number:barcode(qrcode, rotate:R)}
barcolor
string
Color of bars as hexadecimal #RRGGBB
(6 characters required & case insensitive).
Example: {d.number:barcode(qrcode, barcolor:#1FDE25)}
textcolor
string
Color of the text as hexadecimal #RRGGBB
(6 characters required & case insensitive).
Example: {d.number:barcode(qrcode, textcolor:#1FDE25)}
backgroundcolor
string
Color of the background as hexadecimal #RRGGBB
(6 characters required & case insensitive).
Example: {d.number:barcode(qrcode, backgroundcolor:#1FDE25)}
eclevel
string
Specify the error correction level: L
for Low, M
for Medium (default), Q
for Quality and H
for High. Option ONLY FOR QRCODES, Micro QR Code, GS1 QR Code, HIBC QR Code, or Swiss QR Code. Example: {d.number:barcode(qrcode, eclevel:Q)}
type | Barcode type: | string |
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 :html
formatter renders HTML content on DOCX
, ODT
and PDF
documents.
Unsupported tags, attributes and styles are skipped and not rendered.
<br>
<b>
<strong>
<i>
<em>
<u>
<s>
<p>
<a href="URL">
<ol>
<ul>
<li>
<del>
<img>
<a href="URL">
If a font family or/and a font size is applied on a HTML marker, the content is rendered with the same font properties. Text alignment on the rendered HTML content is not kept.
To render HTML lists, such as <ol>/<li>
or <ul>/<li>
, create a bullet list on the template then delete it, then the generated report will render the list.
<img>
The image source attribute can be an URL or Data-URL, such as <img src="https://carbone.io/img/favicon.png"/>
or <img src="data:image/jpeg;base64,/9j...."/>
The image size is rendered based on width
and height
attributes provided by the HTML tag, such as <img src="" width="300" height="100"/>
.
values must be pixels
if width
or height
attributes are missing, the size of 5 cm (1.96 in) is applied by default while retaining the image aspect ratio
When included, the URL format needs to be verified before injecting it into the document. Learn more about .
When the HTML marker is placed inside a paragraph and mixed with other content, the content is pushed in a new paragraph above or below the rendered HTML, refer to .
Formatters accept dynamic variables if parameters start with a .
and are not surrounded by quotation marks.
The following dataset is used in the examples below.
To do mathematical operations:
To insert parent attributes, 2 dots ..
have to be used. To access to grandparents attributes, 3 dots ...
are necessary, etc.:
To read parent objects and their children attributes (no limit in depth):
It returns an error if the attribute does not exist:
It returns an error:
It returns an error if the sub-array is not indexed:
Find answers to frequently asked questions and known issues for printing dynamic layouts
This may be happening when unsupported characters are used or when Ninox field names and template variables do not match.
Tips for naming Ninox fields
Use CamelCase and underscore _
to write field names in a template. Any other characters and white spaces are not supported.
The text editor you're using may replace quotation marks with ones that cannot be interpreted.
Tips for using quotation marks
To use the right quotation marks, perform the following manipulation and use only simple quotation marks (external help page).
showBegin
/hideBegin
) When using conditional formatters showBegin
/showEnd
or hideBegin
/hideEnd
, insert only break lines (shift
+ Enter
).
Break line: The new line is part of the current paragraph by hitting shift
+ Enter
. Behind the scenes, the XML doesn't need to reordered because everything is in the same paragraph.
New line: Close the current paragraph and open a new one, the standard "command" is the Enter
key. Creating a new paragraph automatically inserts a new line. The XML designing the document is getting complex and XML parts have to moved and reordered, which may leave some additional lines on the final report.
Use #drop-element when you conditionally delete paragraphs, table rows, images, charts or shapes. New lines/break lines are not expected to present any issues in that case.
Returns the total sum of data as it grows with series.
The cumulative total of salaries by departments:
{d.departments[i].people[].salary:cumSum}
{d.departments[i+1]}
The cumulative total of salaries by departments and by people:
{d.departments[i].people[i].salary:cumSum}
{d.departments[i+1].people[i+1]}
The cumulative total of salaries by departments: 1000 1700 3200 3400
The cumulative total of salaries by departments and by people: 1000 1500 1700 3200 3400
Flattens an array of a string or a number.
counts and prints a row number of any array
usage example: d[i].id:count()
prints a counter of the current row no matter the value of id
internally replaced by :cumCount
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.
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.
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:
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
Parameters | Description | Type |
---|---|---|
This feature may not work at the time of release. Use in the meantime. We will update this page once it becomes available.
Before continuing, check out this documentation to learn more about .
Paste the , then click the Save button.
separator
[optional] item separator (,
by default)
string
objSeparator
[optional] object separator
,
by default
string
attributeSeparator
[optional] attribute separator
:
by default
string
attributes
[optional] list of object's attributes to print
string
start
number to start with (default: 1)
string