This invoice template is an example taken from the Template Library.

The invoice template below is an example taken from the Template Library. It illustrates how a template document can use several elements, such as tables (with and without borders and coloring), groups of repeating data, calculations, conditional statements, and other field formatting to produce a seamless and customized invoice at merge time.


1A page header. Each page can have its own header or you can repeat headers across pages.
2A borderless table containing the account information. You can apply text formatting, such as colors, font sizes, and so on, to any template text.

The Payment Due Date has a date field adjustment of 30 days from today [details], and is formatted to show the full month name, the day of the month, and the four digit year. [details]

The Total Amount Due also has a Word field formatting picture switch to display the amount as currency. [details]

3The TableGroup field will group like data. In this case, a table of repeating data will appear for each product family listed in the invoice. [details]
4This table row will repeat to display each returned row of data that the solution report or query gathered. Repeating data sections begin with a TableStart field, and end with a TableEnd field. [details]

Repeating information is not confined to a table. You can place detail items directly on a page, to create a list, for example. [details]

5Calculation fields that subtotal the quantity and total price line items in the table above. [details]
6Although this is a summary field of the entire invoice amount, the content comes directly from a Salesforce data field and is not calculated on the template.
7A conditional statement (IF statement) that checks whether the invoice total is over a specified amount and, if so, to add text related to free shipping. This text does not appear for invoices where the total is below the specified amount. [details] This is an example only. Do NOT use double brackets with IF statements.
8The page footer repeats across pages.


When merged, the placeholder merge fields are replaced with data from the Salesforce record. This merged template appears as below: