Request a trial-version now and see for yourself!
Contact us at [email protected].
In this exercise we will enhance the template created in exercise 1: we will use the ForEach-placeholder to produce the list of ordered products.
The prerequisites for these exercises are listed on the Quick-Start introduction-page.
This exercise uses the same data-file as the previous exercise. You can download it here: http://static.docati.com/samples/order-basic.xml (you must save it to a local folder on your computer, you need it later).
The template contains a large table to hold a list of ordered products. The ForEach-placeholder can create such a list. It does so by adding its contents for each item in the dataset. Since we want to create a table, we need the ForEach to contain a single table row, so that it will insert this row for each item.
If you generate the document now (go ahead, just try it!), the resulting document will contain a table with two rows because the data file contains two items. However, these rows are empty, since we did not yet specify what data to put in each individual cell.
The last column in the table should hold the line total. For the Baby Monitor that should be 79.96 (39.98 x 2).
However, the line total is not part of the data. This means we need to calculate it.
The ValueOf-placeholder supports basic calculation operators, so it can do this for us.
The table is now completely populated, except for the Total-cell below the table. This requires a complex formula and is part of exercise 4.