Conditional Formatting

Hello

One of our customers who is using plumsail documents to generate word reports with a cloud flow, would like to conditionally format the color of the field background of a table with marks (decimal numbers).

E.g. if the field value is 1 the field color is green. If the value is 10 the color is red.

Does anyone have an idea how we could achieve this or something similar with reasonable efforts?

Hello @LOEM,

At this moment, it's not possible to control the colors directly from the Plumsail side.

As a workaround, it might be a script inside the docx template that adds a color to each cell depending on the final value. So, when you open the result docx file, it adds the colors to each cell.

Also, I'm going to discuss it with my team, probably there is something easier than this script solution.

I'll keep you posted about the results.

Best regards,
Petr
Plumsail team

Hello @LOEM,

We'd recommend you using an Excel template instead of DOCX template.

You can define a background color of a cell in the Excel table based on a value.

Please check out a detailed instruction on how to set this up in excel file in this article.

So, to sum this:

  • prepare an Excel template with the table, tags and formulas to change the color.
  • fill the template and after opening the result file, the formulas should apply the colors to the cells.

Best regards,
Petr
Plumsail team

1 Like

Thank you for your quick response.

We're already using embedded charts in word, which seems to be similar as excel. For the charts it's working perfectly fine. Unfortunately conditional formatting on cells are not being processed.

But I suppose your suggestion means that we should create the whole report in excel. Right? Or is there any option to embed an excel in word with plumsail documents?

Creating the whole report in excel would be quite cumbersome. It contains a lot of images and lots of formatted/layoutend text.

We have now implemented this requirement by adding the field three times, each in a different color. Finally we hide two of them by the conditionally hide function.

1 Like