Creating invoices is one of the most typical applications for TX Text Control and ReportingCloud. Using MS Word compatible word processing documents as templates is one of the major advantages of the flow type layout reporting concept over other reporting tools.
The difference between Flow Type Layout Reporting and traditional reporting engines is that a template doesn't consist of various reporting items, but floating text. Word processing rules define how a table is wrapped to the next page or when a table header should be inserted. You can keep lines together, control widow and orphans and add forced page breaks to specific paragraphs.
First, let's have a look at the JSON data source that is used to create the invoice:
It contains the typical elements that should be included on an invoice including invoice meta data, information about the payer, the sold products and payment information. In this sample, the total amount, tax and discount values are calculated using formulas in the template itself.
The following screenshot shows the template. The red annotations show the sub-elements in the JSON data. The blue annotation shows that these cells are calculated based on the data that is merged into the template.
The following animation shows the template and the resulting document after the merge process:
Test this sample template on your own
To test this template on your own, follow these easy steps:
Start the shipped demo TX Text Control Words from the created start menu entry for TX Text Control.
Download the sample JSON data source from GitHub:
Download and unzip the sample template:
Load the template into TX Text Control Words.
Select Load JSON File from the Select Data Source drop-down button in the Reporting ribbon tab. Select the downloaded data.json file.
Click Preview from the Finish ribbon group to merge the template.