Skip to main content

Invoice

An invoice whose line items repeat from an array of data.

Open it and take it apart

Everything below is generated from the template itself, so it always matches what you get. Start from this template to open an editable copy.

What it teaches​

  • Binding a table to an array field
  • Referencing item properties inside table cells
  • Tokens with a date format
  • Page numbers in a repeating page footer

The data you send​

Pass this as your render payload. The field names come from the template's schema — rename them there and the tokens follow.

{
"invoiceNumber": "INV-1024",
"customerName": "Acme Corp",
"issueDate": "2026-08-22",
"total": 4250,
"lineItems": [
{
"description": "Design retainer",
"quantity": 2,
"unitPrice": 850,
"amount": 1700
},
{
"description": "Design retainer",
"quantity": 2,
"unitPrice": 850,
"amount": 1700
}
]
}
About the sample rows

The schema stores one sample value per field, so every generated row looks the same. Trimmed to 2 here; your real array can be any length.

How the array reaches the page​

The table's bindingField is lineItems, so its body row repeats once per item in that array. Each cell binds to one property of the item:

ColumnBinds toWidth
Descriptiondescription52%
Qtyquantity12%
Unit priceunitPrice18%
Amountamount18%

A token inside a body cell resolves against that row's item, not the document. That is the single thing people get wrong most often.

Band stack​

A Paperwright document is a stack of bands. This template uses:

  • report-header
  • report-footer
  • page-footer

Properties that matter​

Only properties this template changed from their defaults — anything omitted is left as-is.

BandElementPropertyValue
report-headertextroleheading
report-headertexttextINVOICE
report-headertextfontSize28
report-headertextfontWeight700
report-headertexttext{{invoiceNumber}}
report-headertextfontWeight600
report-headertextalignright
report-headertexttextBilled to {{customerName}}
report-headertexttextIssued {{issueDate | date:"medium"}}
report-headertextalignright
report-footertextrolecaption
report-footertexttextPayment due within 30 days. Thanks for your bu…
report-footertextfontSize10
report-footertextcolor#737373
page-footertextrolecaption
page-footertexttext{{$page}} / {{$pages}}
page-footertextfontSize10
page-footertextcolor#737373
page-footertextalignright

Start from this template →