Knime Reports - how to align data to the right for numerical columns

I have created a report using the Table View Node and wrapping up as a component.
I have a problem where I can’t seem to find a way of aligning the numerical data columns to the right (instead of the left which is fine for the text columns).
Anyone got a solution to this problem?

Hi @John_Hayes,

if you could provide us a screenshot of your issue, that would better us comprehending the exact context.

Thanks
Mike

2 Likes

Hello @John_Hayes ,

aligning numbers to the right is planned with version 5.3 (to be released in July).
If you are eager to test, you can download the Nightly and try the Number Format Manager – KNIME Community Hub , which has an additional setting “Alignment suggestion”. Beware though that the nightly is not ready for production use.
As a workaround, I would suggest to convert the numbers to strings and add some whitespace padding to the start using the String Cleaner – KNIME Community Hub .

Have a nice day,
nan

2 Likes

Hi Mike,

Thanks for the reply, please find a screenshot of part of the pdf output. As you can see everything is aligned to the left in Knime when utilizing the “Table View” node.

Unfortunately this is no good if you want to show any columns aligned to the right (or even the center). I have a need to align the “MINUTES” and the “USD” columns to the right so they look more professional.

Hi Nan,

Thanks for the reply. I hope that the Knime team has also planned aligning columns to the centre also (as future users including myself will need to have this capability too).

Whilst I await eagerly for the July release of Knime, I will of course try the workaround.

many thanks,
John

Hi @John_Hayes.

thanks for the details. I fully agree that numbers aligning left is aa UI and typograhic nightmare. The only possible solution I can imagine is to create a report using the report editor:

https://docs.knime.com/latest/analytics_platform_reporting_guide/index.html#open-layout-editor

Then trying to inject CSS through the method “additionalStyles” in the Advanced Compsite View Layout Tab:

https://docs.knime.com/latest/analytics_platform_components_guide/#_view_content_5

Bare in mind that the new nodes might ignore that. The other option would be to use the JavaScript based nodes in conjunction with the CSS node:

Details about CSS classes can be found here:

https://knime.com/css-styling

Happy “kniming”
Mike

@nan
Thanks. I tried your suggestion of downloading the [Number Format Manager – KNIME Community Hub ] - unfortunately I can’t see the additional setting “Alignment suggestion” so I can’t test that method.

Do you know when Knime version 5.3 is coming out? I have spent many hours designing a workflow to create intercompany invoices for my company but not being able to align numbers to the right really is a “deal-breaker” as it make the invoices look so unprofessional.

KNIME 5.3 has been released already… when you go to download it will be the default version to be downloaded. You can also “update” your existing installation.

Menu => Check for Updates. (in Modern UI)

Here’s the blog post:

2 Likes

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