A domain service for mail merging Word (OpenXML .docx) files … with repeating data

One requirement that most business apps have is to be able to dynamically generate Word documents. For scalar non-repeating data this is not too difficult in .docx; indeed the file format has built-in support for data binding using Custom XML Parts. However, there is no support for repeating data, at least, not prior to Word 2013. Which is where a little domain service that I’ve been working on comes into play

The service works by accepting a .docx template and an XHTML input document. The @id attribute of the input elements is matched to the tag of the smart tags in the .docx. Repeating lists are specified in the input HTML using <ul> / <li> / <p>, and tables are specified using <table> / <tr> / <td>. The service will clone the template list item / table rows as necessary.

For now, you can grab the code from my github repo (where there’s a more thorough README); in the fullness of time it’ll be donated into Apache Isis codebase.

About these ads

Posted on November 9, 2012, in Uncategorized and tagged , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 248 other followers