The OfficeUtils component consists of two modules:
Word generation:
Word generation is based on a template with placeholders, which will be replaced using the available helpers (server actions).
Word generation steps:
Provide a template document, and specify unique names for the placeholders that should be replaced. The template document is mandatory. Include your template document in Resources folder of your module. A template example is available for download in the demo.- To add a text or a picture, your placeholder should be like this example:
- To add a table to the document, create a table with a template row containing the placeholders:
Excel generation:
We advise to download and install the component demo, as it provides implementation examples of the several OfficeUtils usage scenarios:
- To add a table to the document, one cell with the placeholder inside should be created.
(the styles of this cell will be applied to every cell of the table):
Note: Please do not use the soft enter in your template. The NPOI library has a bug which causes soft enters to be replaced by page breaks. Use paragraph definitions to control the space between lines instead.