Paste Image to Write To Excel Template Node

Hello,

Tried these nodes but the image is not pasting in Write to Excel Template eventhough in my output in KNIME from Column filter, it is showing the image but when i executed it with write to excel template, it is showing as text instead of image.

@iCFO

This should appear in my excel:

This is the one appeared instead of the image:

Can you upload a workflow with the necessary test files in the workflow data folder?

1 Like

IMAGE_TEST.knwf (305.6 KB)

I have included in the ‘data’ folder the image and sample template. Thank you @iCFO!

@trafalgarlaw you can try this approach to place images in Excel.

1 Like

Hello @mlauber71 is there other way not to use python?

@trafalgarlaw the other link I think shows the use of a community node to write to an existing Excel sheet but I have not tried that.

With the integrated python extension in knime and this example that should not be that hard I hope.

Edit: we had this topic before. I would encourage you to give knime and python a try. These days with ChatGPT around it should not be that hard and will greatly improve your skills and abilities.

2 Likes

Alright will try this, but will Python can paste the image to an existing excel template?

1 Like

@trafalgarlaw the other link I think show - i think this one is from @iCFO - have you tried my workflow because I tried to follow yours but it seemed mine is not working for write to excel

Hello, I am trying the python way now but if it is okay with you, would you mind me sending the script here because I can’t see it maybe because of KNIME version difference as I am still at 4.6.5.Similarly the column renamer. Thank you so much!

@trafalgarlaw you will store the image as a file in your machine and then place it on an existing sheet starting at a specific cell like A1 or so. You can use knime to steer and integrate this process.

1 Like

@trafalgarlaw I am on a mobile device right now. This older workflow has this function also:

Basic code like this

https://openpyxl.readthedocs.io/en/stable/images.html

2 Likes

There is something odd going on with this workflow @trafalgarlaw. There doesn’t appear to be anything wrong with your configurations. I am getting the same result of writing png files as a string if I use or modify your workflow. However, it appears to work fine if I build the same workflow from scratch… I also noticed that your nodes didn’t want to release your existing local file location settings in the list files / write to excel nodes when I tried to switch it to relative to workflow data. I ended up having to replace and duplicate them in order to adjust the file locations without errors.

I noticed that you are using the depreciated version of Write to Excel Template. Which version of KNIME AP are you using? If you started by modifying my workflow which was created in a later version, then perhaps it has caused a corruption in the workflow? Very strange issue, and I can’t recreate it outside of your workflow.

3 Likes

OH I see will try to recreate a new one instead. :slight_smile: Will let you know @iCFO Thank you so much!

Thank you @mlauber71 it worked the code!! Thank you so much!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.