Search
⌃K
Links
🆕

Test print with watermark

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.

Option A: without a custom script (Ninox UI)

Option A: Toggle ON Test print (1), then click Print (2) to download a test PDF with a watermark
Using data from Example: invoice PDF, view the files below: a test print with a watermark and a final print without a watermark.
test print with watermark.pdf
91KB
PDF
final print without watermark.pdf
81KB
PDF

Option B: with a custom script

printRecord(this, "templateLayoutName", data)
printAndSaveRecord(this, "templateLayoutName", data)
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.

Example

  1. 1.
    Add a new layout element, here: a button.
  2. 2.
    Paste the script below in the formula editor.
  3. 3.
    Save changes.
  4. 4.
    Click or tap the button to run the script.
1
printRecord(this, "en_invoice_template", {
2
date: "02.09.2022",
3
notes: "Net 30",
4
invoiceNumber: "RE-00001",
5
totalNet: "1,342.30 €",
6
totalGross: "€1,597.34",
7
paymentTerm: "30.09.2022",
8
vat: [{
9
rate: "19%",
10
amount: "€255.04"
11
}],
12
customer: {
13
companyName: "Happy GmbH & Co. KG",
14
salutation: "Mrs.",
15
lastName: "Sorglos",
16
department: "Purchasing",
17
address: "Willy-Brandt-Weg 2",
18
postalCode: "10178",
19
city: "Berlin"
20
},
21
contact: {
22
name: "Elsa Excel",
23
phone: "(030) 234 567 89",
24
25
},
26
items: [{
27
pos: 1,
28
article: "Ninox Cloud",
29
number: 10,
30
price: "€120.00",
31
sum: "€1,200.00"
32
}, {
33
pos: 3,
34
article: "Ninox coffee cup (porcelain)",
35
number: 5,
36
price: "€7.50",
37
sum: "€37.50"
38
}, {
39
pos: 4,
40
article: "Ninox coffee cup (recycled)",
41
number: 10,
42
price: "€0.49",
43
sum: "€4.90"
44
}, {
45
pos: 5,
46
article: "Ninox basecap",
47
number: 10,
48
price: "€9.99",
49
sum: "€99.90"
50
}],
51
_options: {
52
testPrint: true
53
}
54
})

Result

A report (PDF file) is created and downloaded to your local files.