Skip to main content
Question

MSWordStyler how to include picture in table?


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor

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

arnovananrooij
Contributor
Forum|alt.badge.img+5

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.


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • March 7, 2019

Do you need to avoid python?


jdh
Contributor
Forum|alt.badge.img+28
  • Author
  • Contributor
  • March 8, 2019
ebygomm wrote:

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.

ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • March 8, 2019
jdh wrote:

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.


jdh
Contributor
Forum|alt.badge.img+28
  • Author
  • Contributor
  • March 11, 2019
ebygomm wrote:

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.


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • March 11, 2019
jdh wrote:

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

 


jdh
Contributor
Forum|alt.badge.img+28
  • Author
  • Contributor
  • March 11, 2019
ebygomm wrote:

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.

oliviergayte
Contributor
Forum|alt.badge.img

Thank you egomm.

Your script is great!


venu
Contributor
Forum|alt.badge.img+5
  • Contributor
  • April 3, 2022
jdh wrote:

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


andreaatsafe
Safer
Forum|alt.badge.img+10
jdh wrote:

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


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