Add sheets on a excel file in the server

Hello community, I have a workflow that uses an .xlsx file which contains Pivots reports, those pivots are fed from other sheets in the same excel, these sheets are added by my workflow… so the thing is that in my PC I use the node copy/move to move the xlsx file from the Local KNIME location to a temporally folder, where the workflow then inputs the new sheets on the file… afterwards its sent via e-mail to the end user…

the problem is that I moved this workflow to the server, but the copy/move fails stating that the URL file is not Local, I have been arround reviewing some options but always fail… do you have any clues of what should I do to fix this up?

Hi,

it is highly discouraged for workflows to read/write from/to disk manually on KNIME Server as then the workflow is dependent on the setup of KNIME Server and also could bear some security issues (e.g. users accidentally overwrite another file etc). Thus, we also advice to restrict the access to the machine of the executor when setting up KNIME Server. Furthermore, these workflows usually won’t work properly (at all) if you switch to distributed executors.

In your case, the best option would be to read in the xlsx file into the workflow, append your columns and write it into a temporary directory using the Create Temp Dir node.
Writing directly to the server repository via a knime://-URL will overwrite your existing file, as there is no option to simply append rows.

Cheers,
Moritz

2 Likes

Hello Moritz, Maybe I didn’t explain the right way, but what you are stating its what I think Im doing, please see attached the sample workflow, it works perfect in my PC, but when going to server there is an error that I cannot solve; can you please take a look and show me where Im doing something wrong?

Move Excel File to add new sheets IN SERVER.knar (50.6 KB)

1 Like

Hi,

I just noticed that the knime://-URL in your Constant Value Column is knime://LOCAL/tests/test.xlsx. LOCAL really defines your local workspace, you should use knime.workspace denoting the workspace on where the workflow is executed.
But you still would have the problem that this wouldn’t work in case of Distributed Executors.
I’ve adjusted your workflow and uploaded it to KNIME Hub:

https://kni.me/w/XBAqdVgDxt8E2QaV

I’m using the KNIME Server Connection node to establish a connection to KNIME Server and then download the Excel sheet into a temporary directory. This is a workaround as the Copy/Move Files unfortunately doesn’t support the knime://-URL. After that I simply append the sheet.

Cheers,
Moritz

2 Likes