Skip to main content
Solved

Trying cell value based colors in Excel. ExcelStyler is simple and straight forward. Still I am missing some fundamental principle is missing. Attached workbench has very easy example to demonstrate how I mange to create non-formatted excel file

  • February 23, 2022
  • 6 replies
  • 72 views

jakomies
Trying cell value based colors in Excel. ExcelStyler is simple and straight forward. Still I am missing some fundamental principle is missing. Attached workbench has very easy example to demonstrate how I mange to create non-formatted excel file.

Best answer by ebygomm

You need to have the .formatting attributes exposed on the writer

image

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • 571 replies
  • February 23, 2022

If you use ExcelStyler you have to set Attribute Definition in the writer to Automatic.

You also should set an Else value for the backgroud colour.


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • Best Answer
  • February 23, 2022

You need to have the .formatting attributes exposed on the writer

image


jakomies
  • Author
  • 6 replies
  • February 24, 2022

If you use ExcelStyler you have to set Attribute Definition in the writer to Automatic.

You also should set an Else value for the backgroud colour.

Attibute definitio/type doesn't matter.

Else value is not needed. Actually it is better to leave empty because there is 'No Fill' option.


jakomies
  • Author
  • 6 replies
  • February 24, 2022

THX!

This solved the issue.

Actually this is forst topic in Formatting section in Excel writer documentation. Somehow I hadn’t internalized the matter. 

Interesting is that this example is working without those .formatting attributes in writer side:

https://community.safe.com/s/question/0D54Q000080heIxSAI/style-excel-cell-values (fme2018-beta-excelstyler-example-2.fmwt).


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • February 24, 2022

THX!

This solved the issue.

Actually this is forst topic in Formatting section in Excel writer documentation. Somehow I hadn’t internalized the matter. 

Interesting is that this example is working without those .formatting attributes in writer side:

https://community.safe.com/s/question/0D54Q000080heIxSAI/style-excel-cell-values (fme2018-beta-excelstyler-example-2.fmwt).

In earlier versions of the excel writer it didn't used to be necessary so I expect that is why that example works without​


jakomies
  • Author
  • 6 replies
  • February 24, 2022

In earlier versions of the excel writer it didn't used to be necessary so I expect that is why that example works without​

Correct.

I made 'Update Writer...' to that writer in the example workspace -> value based cell fill no longer works.