Solved

MailMerge

  • 17 October 2019
  • 2 replies
  • 16 views

Badge

Hi, I have a Aggregator feeding into two MSWordStyler's (header and footer). I have another MSWordStyler with content type table which is fed by same input source as the aggregator. All three MSWordstylers feed into MSwordWriter. I'm using a fanout expression. All of these are giving me one word document per customer with the correct header and correct footer and a table with transactions for that customer. Which is great.

Even the Document name has the supplier number in it.

HOWEVER, the table is at the top of the word document then the header and footer. How can I get these to feed into the word writer in correct order.

From forum posts, they recommend creating stylers in correct order in the first place but this did not work for me. They also recommend using the WordGenerator but I can only get one single word document from that and all transactions for every customer are included in the same table i.e. it does differentiate between customers within the word document or allow multiple word documents outputted.

Any help appreciated here, thanks.

Joan

 

 

icon

Best answer by hollyatsafe 17 October 2019, 22:58

View original

2 replies

Badge +2

Hi @jwcc,

The Microsoft Word Writer will write out features in the order they are received, therefore to ensure your document elements are written in the correct order I would first add an AttributeCreator after each MSWordStyler and create a new attribute 'Order' and for the value this should be a numeric count e.g. Header=1, Table=2 etc. Then insert all the outputs into a Sorter transformer and for this new Attribute sort by Numeric and Ascending. This will ensure the features hit the writer in the correct order.

Badge

Hi @jwcc,

The Microsoft Word Writer will write out features in the order they are received, therefore to ensure your document elements are written in the correct order I would first add an AttributeCreator after each MSWordStyler and create a new attribute 'Order' and for the value this should be a numeric count e.g. Header=1, Table=2 etc. Then insert all the outputs into a Sorter transformer and for this new Attribute sort by Numeric and Ascending. This will ensure the features hit the writer in the correct order.

Perfect Holly, much appreciated. The mail merge works perfectly now based on customer number.

Thanks.

 

Reply