Skip to main content
Solved

MailMerge


Forum|alt.badge.img

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

 

 

Best answer by hollyatsafe

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.

View original
Did this help you find an answer to your question?

2 replies

Forum|alt.badge.img+2
  • Best Answer
  • October 17, 2019

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.


Forum|alt.badge.img
  • Author
  • October 18, 2019
hollyatsafe wrote:

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.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings