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
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.
Both MS Word templates A and B result in the same report. All roads lead to Rome.
What | File format | EN | DE | Notes |
---|---|---|---|---|
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