XLS Formatter (apply)

Hi @Anjo , I tried out the sample workflow locally, and tried to adjust it to write directly to the workflow folder, and for some reason the Excel Writer itself didn’t want to work for me. If you haven’t already done so, take a look at the new workflow I uploaded (mentioned in my last message which you might not have seen), and see if you can use my “Open File or Folder” component in the workflow to supply the Path variable to the Excel Writer, and the String version of the variable to the XLS Formatter. This component can create a path to the Workflow folder, but it will create it as an absolute native filepath rather than a “local” knime path, and I wonder whether using that in both nodes will help, as it worked for me when I tried it here. I hope that would work on the server too!

Hey @takbb,

you were right I did not see the new workflow provided… sorry. I will test it as soon as I have a slot on the server (hopefully today) and will get back to you.

Maybe I should also clearify, I do not need to specifically write directly to the workflow folder but rather the workflow-group folder (on the server) and more precise in a temporary location but the workflow folder is also fine (the workflow-group folder would be nice as I can see that the file is created when not directly working on the server machine).

I will give an update when I tested the new workflow.

Hi,

so I tried the new workflow and I was not able to make it work. I think one of the problem that occured is that the path variable was not created correctly when running the job on the server (which I did not observe before).

First I could not use the config of the “Open File or Folder” Component as it is possible when running the workflow on the local machine.

The only changes I made to the Workflow are the KNIME Server Connector node. There you have to provide the “working direktory” (the config I use works in other workflows but may have an inpact on the path structure… or perhaps not)

So I try to recapitualte what happened:

1. Run the new workflow on the server:
image


  • XLS Formatter config:
    image
    → File not found

  • Check Excel Writer Config - Flow Variables
    image

→ the path variable seems to be missing!
→ there was an artifact in the File path of the Excel writer config that seemed to be active when the path variable is missing causing the Excel writer to be executed without failing


  • Check with the “Java Edit” node (no configuration, just to have the output of the component)
    image

→ there is no path variable (I checked it locally and there the path variable is created)


  • Inside the component everything is executed
    image

→ I checked also the Component setup and it seems that the variables are forwarded


  • I tried to create a path variable from the available strings with the “String to Path (Variable)” node
    image
    → well that did not work… and I don’t now why

Conclusion → Confusion:

  • There are some strange things going on and I cannot get my head around it.

I should perhaps mention at that point that the KNIME version is 4.3.2 which is neccessary to be compatible with the server version. Perhaps this creates a problem but I and other colleagues have workflows running without these kind of problems.

1 Like

Hi @Anjo,

Could you please send an email to support@knime.com with a link to this forum thread? Then, we can arrange a call and look at the issue together.

For others, we will also post the root cause of the problem and its solution here.

Best,
Temesgen

2 Likes

Hi,
With the help of @temesgen-dadi we were able to find a solution for the XLS Formatter (apply) node in the server setting.

The short version of the solution:

For the “XSL Formatter (apply)” to work on the server, the Excel Writer need to write the respective .xsl file directly inside the workflow folder using custom url (e.g. (CUSTOM_URL, 1000, knime://knime.workflow/testoutput.xlsx)).



For those who are interested in a more detailed version:

  • Select Filename:
    image

  • Create the string version of the file path to the workflow folder with the “Java Edit Variable” node:

image

  • The “Excel Writer” node needs a string → “string to Path (Variable)” node. Make sure to (select Custom/KNIME URL)
    image

  • The “Excel Writer” config:
    image
    image

image

  • The XLS Formatter (apply) node config:

→ On the server it seems better to not select the “open output file after execution” option.

image

  • Download option with the File Download Widget (same path as Excel Writer node)

image

On the Webportal:

  • For the Widgets to be displayed in the webportal you need to create components
    image

image

  • Select File Component:

image

  • Download File Component:

image

Debugging?

  • There is one point that I still find a bit confusing and that might make debugging a bit challenging:
  • When you run the workflow as a temporary copy or directly on the webportal the workflow runs without failing
  • But when you run the workflow “as new Job on Server”
    image

o It still seems to work:
image

o But you can’t download the file:

image

o And when you look at the output of the “string to Path (Variable)” node:

image

→ There is no path variable created!?

  • The “Excel writer” config is still controlled by a variable:

image

  • But the flow variable is not available!?

image

→ I first thought the “Excel Writer” works because of the artifact file path in the main config page.

  • But the path in the XLS Formatter (apply) is correct

image

Conclusion:

  • The XLS File Formatter (apply) works when you write the file with the Excel Writer node to the workflow folder
  • A bit confusing is that when running the workflow “as Job on the Server” (not in the Webportal) the path variable seems not to be created, which doesn’t seem to have an impact on the XLS File Formatter to select and format the correct file
  • Note: In my previous posts I only tested the workflow locally or run “as a job on the Server” thus other path solutions might still work !?

Again thanks @takbb and @temesgen-dadi for helping me find a solution that works.

3 Likes