Format Date in Write To Excel Template

i’m experiencing an issue when writing a field of type “date” into an excel
file.
Actually i write the field of type date with the node “Write To Excel
Template”.
Into the template file the column is formatted as a date in italian format
dd/MM/yyyy.
Knime writes the date but the excel file shows it in the format yyyy-mm-dd
but excel doesn’t recognized it as a real date…
and only by clicking double into a cell,it shows the date in the desired
format.
Do you know why? Is there a correct way to write a date in italian format and
having excel that recognize it correctly?
Thank you all!

Hi @albpesca_knime & welcome to the forum

The following recent topic addresses exactly the problem you described with various proposed solutions:

Hope it helps.

Best
Ael

4 Likes

Hi @albpesca_knime , and welcome!

Further to the information in the thread mentioned by @aworker , one of the suggestions leads to the use of the “Continental Nodes” for XLS Formatting, (as noted there by @iCFO) . These nodes are very powerful and can achieve what you require, but there can be a bit of a learning curve initially as you need to know how to create “tags” for the cells, or cell ranges that you wish to format.

The trouble I had was that I needed to do this very occasionally and then I could never remember how to do what I needed to do!

For this reason, I created a component that works with the Continental Nodes, and does all the hard work of generating tags, to cover most scenarios, so you don’t really have to think too hard about it.

Add it to workflow like this:

The second data output port supplies tags to cover most scenarios from the input data. For date columns, it will generate a tag named “t:Local Date”. The created tags can then be referenced using the Continental XLS Cell Formatter node, by connecting this port, along with the green “XLS Formatter” port. The upper port is your data which must be passed to an Excel Writer, and then the created XLSX file (without formatting) is used by the XLS Formatter node to generate a formatted XLSX file.

In the attached demo workflow, you can see that the date is formatted as required:
image

image

Formatting Excel Dates.knwf (113.7 KB)

You may still find you need to understand a little bit about how this works, so a more detailed post about using the Auto Tag Generator component is available here:

10 Likes

Very cool component @takbb !

Thanks for that share.

2 Likes

@albpesca_knime beside the already answered workaround - could you provide an example workflow for this? Will check to fix it in the node as well

2 Likes

By the way is it already compatible with version5?
br

1 Like

:see_no_evil: hopefully this weekend
had a bit of a hold up due to vacation
Hope will not be the last one to provide it to Steffen :sweat_smile:

2 Likes

Dear @takbb , thank you very much for the great solution! It worked very well!!!

1 Like

You’re welcome @albpesca_knime , I’m glad it worked for you

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