We currently use Word for mail merge (labels) and personalized greeting cards (contact name in the text).
Because our contact information is stored on a Web platform (SharePoint), I was thinking about replacing the Word templates with Web-based templates. The idea would be to use a JavaScript templating engine like Mustache to generate the html documents. Or another approach would be to use XSLT.
Has this been done already? What would be the pros and cons of Web templating vs. Word?
For us it proved quite useful to use Templates stored in the Open Document Format. We then parse the contained script tags (text:script) to build XSL stylesheets for content and styles.
The data is stored in a Postgres database and formatted as XML directly by the database. When the XML is transformed using the XSL stylesheets, the contents of the ODF documents will be the result.
Those generated ODF documents are then processed with LibreOffice to generate a wide range of output formats.
The pros from this workflow are:
The cons are:
You need to be aware that this setup is intended to be used with a server for report generation and therefore complex to setup initially.
I would argue against using HTML and JavaScripts to generate reports due to HTML not being suitable for printed layouts. Instead just use a web application entering data and triggering report generation with a setup similar to the one described above.
It might also be worth investigating the production of LaTeX files from XSL instead of ODF if you are aiming for superior layout.