Skip to main content

I would like create a MSWord document that includes a table that has 3 columns. The first two columns are just attributes, but the third should be a thumbnail image, whose path is stored in an attribute.

 

 

I can use the MSWordStyler to generate a table, I can also use it to add the pictures.

What I haven't been able to figure out is how to add the pictures in the 3rd column of the table.

I don't think this is possible in word with FME. It is possible in html with the html report generator using custom HTML:

https://knowledge.safe.com/questions/84748/conditional-html-report-formatting-and-table-conte.html

You can open HTML documents with word.


Do you need to avoid python?


Do you need to avoid python?

No, python is fine.

 

 

What I'm hoping to avoid is falling down the rabbit hole of custom jsonSnippets/XML that @janb pioneered.

No, python is fine.

 

 

What I'm hoping to avoid is falling down the rabbit hole of custom jsonSnippets/XML that @janb pioneered.

I have a workflow that creates the table in a word document with the image column populated with the imagepath, then after a featurewriter uses a pythoncaller to replace that text with the image specified by the path. It's on my machine at home, so I can share later.


I have a workflow that creates the table in a word document with the image column populated with the imagepath, then after a featurewriter uses a pythoncaller to replace that text with the image specified by the path. It's on my machine at home, so I can share later.

@egomm I would love to see that workflow.


@egomm I would love to see that workflow.

write_to_word_python.fmwt

It's never been used in anger, but was something I was experimenting with, but might give you some ideas.

 


write_to_word_python.fmwt

It's never been used in anger, but was something I was experimenting with, but might give you some ideas.

 

Thanks, this gives me lots of ideas.

 

 

EDIT: docX is awesome, I've gone to creating the entire document in python, rather than have a dozen samplers and MSWordStylers to create all the necessary hierarchy.

Thank you egomm.

Your script is great!


No, python is fine.

 

 

What I'm hoping to avoid is falling down the rabbit hole of custom jsonSnippets/XML that @janb pioneered.

can share again


No, python is fine.

 

 

What I'm hoping to avoid is falling down the rabbit hole of custom jsonSnippets/XML that @janb pioneered.

Hi @venu​ ,

The comment above has been updated with the link to the workspace "write_to_word_python.fmwt" now.

-Andrea


Reply