Question

MSWordStyler how to include picture in table?


Badge +22
  • Contributor
  • 1959 replies

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.


10 replies

Badge +4

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.

Userlevel 1
Badge +10

Do you need to avoid python?

Badge +22

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.
Userlevel 1
Badge +10

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.

Badge +22

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.

Userlevel 1
Badge +10

@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.

 

Badge +22

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

Badge +10

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