Skip to main content

Hello,

 

I have multiple records with 3 attributes which i'd like to format a particular way into a word document (see below)

Input Ex:

 

At the moment, I use two MSWordStyler transformers taking said record and styling both the Title and the Heading.

 

Unfortunately when it runs, the heading information reaches the writer first before the title. As such, the heading is above the title in the word document. My question is how can I specify which document element gets written first? Is there a way to control the input order?

You can play with Heading level. If you set title as Heading 1 and heading as Heading 2, it should be fine.


You can play with Heading level. If you set title as Heading 1 and heading as Heading 2, it should be fine.

@canerakin111, unfortunately, the requirement for the title and heading is to have more style such as customized font, alignment and color. Using the heading content-type doesn't allow to do that. I guess I should have also mentioned that I'll be adding multiple paragraphs underneath eventually.


@canerakin111, unfortunately, the requirement for the title and heading is to have more style such as customized font, alignment and color. Using the heading content-type doesn't allow to do that. I guess I should have also mentioned that I'll be adding multiple paragraphs underneath eventually.

Would you be able to provide a workbench with sample data?


Would you be able to provide a workbench with sample data?

@canerakin111, I think I figured out the order issue. What I realized is that if you have multiple MSWordStyler transformers in parallel going to the same writer, they essentially transfer their results in the order those transformers came into the workspace. So in my situation, I brought in the subtitle MSWordStyler before the title MSWordStyler. Hence it wrote in that order. It didn't matter if you configured the parameters for Heading 1 Heading 2, or paragraph. I was completely unaware of the requirement and there is no documentation on how to properly use the transformer. SAFE should create an article regarding the Word Writer and MSWordStyler.

 


@canerakin111, I think I figured out the order issue. What I realized is that if you have multiple MSWordStyler transformers in parallel going to the same writer, they essentially transfer their results in the order those transformers came into the workspace. So in my situation, I brought in the subtitle MSWordStyler before the title MSWordStyler. Hence it wrote in that order. It didn't matter if you configured the parameters for Heading 1 Heading 2, or paragraph. I was completely unaware of the requirement and there is no documentation on how to properly use the transformer. SAFE should create an article regarding the Word Writer and MSWordStyler.

 

I am happy that you found a solution. Yeah, it is frustrating that there is no source to check. Sorry that couldn`t help you:(

Good luck! Have a nice day!


@mariofederis I have found a solution to this that works for me:

If you first set Creators before each MSWordStyler you want in the document.

Then set the Creator runtime Order for all those Creators: the one that should be first shall be last in that order.

And after each Creator there must be a Sorter and the name of the Sorters must be like this: the higher name or value on the sorter the higher the MSWordstyler will write in the Word document.


@mariofederis I have found a solution to this that works for me:

If you first set Creators before each MSWordStyler you want in the document.

Then set the Creator runtime Order for all those Creators: the one that should be first shall be last in that order.

And after each Creator there must be a Sorter and the name of the Sorters must be like this: the higher name or value on the sorter the higher the MSWordstyler will write in the Word document.

You can also use an AttributeCreator with a attribute with a sort order before or after each MSWordStyler. After that you can use the Sorter that @dalneberg​ suggests.


Reply