Best Manufacturer Awards
Streamline your document creation process with Carbone
- Template type document docx simple
- Carbone min. v5.0.0+
- Features loop nested array
- Target award management result custom
Objectives
You want to generate an award with the following features:
- Display a table,
- Display a nested array, and avoid unnecessary repetition
Solution
Here’s how you can achieve this using Carbone:
Insert a table to display your data.
Note: In the table properties, set the text wrapping to "None." Uncheck "Allow row to break across pages" to maintain consistency.
To generate a row for each key, insert the apropriate Carbone tag to read the data from your array (e.g.,
{d.manufacturers[i].name}
). Then, define the iteration in the next row (e.g.,{d.manufacturers[i+1]}
)Note: Highlight the first row of your main table, and select the option "Repeat as header row at the top of each page." to ensure it appears as a header on every page.
Insert a table within a cell to display a nested array
Define the data to display (e.g.,
{d.manufacturers[i].models[i].name}
), and its iteration (e.g.,{d.manufacturers[i].models[i+1]}
)
And there you go!