1
0
-1

We have a letter that a lot of our users require part way through our form process. This letter is a single page Word document and contains just a few pieces of data. At the moment, the user sends an email request to our office and someone manually fills in the Word document for the requestee and emails it back as an attachment. The information they fill in is already collected on screen, so it seems OTT to get a person involved! 

What I'd like to do, is have the Word document uploaded in TM and the data can be populated using a service call from the form; then the system can send the document attachment automatically... Is this something that can be achieved? I can obviously make another composer form that has a prefill service and open this from the main form; but I ideally want it to remain as a Word document so that it can be emailed around. 

Any help in this area would be appreciated.

Cheers,

Rich 

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hi Richard,

      Yes, this could be done. Transaction Manger includes the Apache POI libraries which can be used to author Microsoft documents.

      You can find more infomation on Apache POI here: http://poi.apache.org/

      The version of Apache POI included within Transaction Manager is listed in the Avoka Transact Services Guide under Service Development, 3rd Party Libraries. The guide is located under the Services menu in Transaction Manager.

      One approach you might consider could be to:

      1. Develop a 'document data merge' service as a generic Groovy service type. The Word document template could be configured as a property of this service. This service would be responsible for performing the data merge from the data passed to the service and returning the resulting document data (e.g. a byte array).
      2. Develop a dynamic data service that can be invoked from your form. This service would be responsible for marshalling data to the data merge Groovy service above and queuing the email - as well as the relevant error handling etc.

      This will allow you to encapsulate your data merge functionality and potentially leverage it in multiple scenarios if need be.

      Cheers,

      Matthew

       

       

       

       

       

       

      1. Richard Cassell

        Hi Matthew, That's great thanks. I'll have a read up and come back if I hit any trouble! Sounds just like what I'm after though! :) Cheers, Rich

      CommentAdd your comment...