Word Template

Content Type: Module
Categories: Import/Export

Overview

This module can generate fully styled Word documents based on Word templates, including word replacements, footers/headers, tables, (un)orderdered lists, pictures, rich text and even charts!

Documentation

Demo urlhttps://wordexporter127-sandbox.mxapps.io/index.html?profile=Responsive

Description

Generate fully styled Word documents populated with data from your Mendix application! Even Excel graphs based on Mendix data are included! No need for Aspose or other paid third party license; pure Mendix and Java! 

 

Typical usage scenario

When your Mendix app needs to be able to generate Word documents with proper styling as well as potential Excel graphs based on data from your Mendix application.

 

Features

  • The Word document is based on a template, maintained in Word;
  • All styles from the Word document (font size, color, etc) will be maintained;
  • The Word document can be updated with data coming from your Mendix app, preserving all styling. This works for plain text and when used in bullets / headers / tables as well;
  • If your Word document has Stacked Bar Chart templates, the Stacked Bar Charts can be updated with data coming from your Mendix app! Currently only Stacked Bar Charts and Line Charts are included;
  • Exporting to PDF is not fully working yet, see limitations. Mostly charts aren’t working.

Limitations (not included)

  1. Other types of Chart templates than Stacked Bar and Line Charts;
  2. PDF export is not working perfectly yet. For plain text it will work, but Charts are not included and table margins are looking off;

Supported scenarios 

  • Export to Word replacing tokens (=BookmarkValue) in the template for Mendix values (=ReplacementValue), preserving font styles;
  • Adding custom tables, rich text, (un)ordered lists and images
  • Adding one or many Stacked Bar and/or Line Charts with data form Mendix.

Dependencies

Can be found in the Settings tab of the module and are related to Apache POI. Since the Excel Importer and Excel Exporter module also use these JAR files, try to keep them in sync at all time!

 

Installation

Just download the module. For implementation, see demo project: https://marketplace.mendix.com/link/component/111539

 

Configuration

For a demo, see https://wordexporter127-sandbox.mxapps.io/index.html?profile=Responsive

 

If in doubt on what is going wrong, proper Trace logging is added; set the Log level of the ‘Word’ node to Trace to see what is happening within Mendix!

Releases

Version: 7.3.0
Framework Version: 10.24.1
Release Notes:

- Added a MergePDF Java action, because of conflict with Community Commons.

 

If using Community Commons (CC), it uses a lower version of PDFBox, in this case 2.0.30. The Java action mergeMultiplePDFs of the CC module will not work. WordTemplate uses a newer version, PDFBox 3.0.5. Hence for now added a MergePDF Java action which is compatible with WordTemplate. A ticket is logged at Mendix to ask for an upgrade of Community Commons PDFBox dependency, so this mergePDFs Java action becomes obsolete.

Version: 7.2.0
Framework Version: 10.24.1
Release Notes:

- For Word/PDF: Fixed know bug from version 7.1.0 about extra empty lines

- For PDF: Fix for long words in PDF table causing word to overflow cell.

Version: 7.1.0
Framework Version: 10.24.1
Release Notes:

- Word+PDF: Added handling of vertical / horizontal alignment of text elements

- PDF: Added a fix so horizontal overflow (table stretching outside of page) doesn't happen anymore.

Version: 7.0.0
Framework Version: 10.24.1
Release Notes:
  • Added support for tables in rich text
  • Code cleanup and refactoring
  • Fixed bug with tables not used still staying in template. Not used 1 by 1 tables are now removed when the template is being filled.
  • Upgraded managed dependies to newest versions
  • For PDF moved from opensagres / itext to Docx4J
  • For PDF: Fixed an issue with rich text table styling
  • For PDF: Fixed an issue for table (both normal and rich text) column widths, autosizing
  • For PDF: Fixed an issue with unordered lists not showing a bullet
  • For PDF: Fixed an issue with both unordered lists and ordered lists on second level where indentations was not enough between list item identifier and value, partially overlapping.

 

Version: 1.1.1
Framework Version: 10.24.1
Release Notes: - Updated module package
Version: 1.1.0
Framework Version: 10.24.1
Release Notes: - Added poi-ooxml-full dependency - Fix for PDF export. Working again.
Version: 1.0.0
Framework Version: 10.24.1
Release Notes: This module is an extract from the Word Template demo project, also available in the Marketplace.