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
  • 52 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

View original
Did this help you find an answer to your question?

6 replies

caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • 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+38
  • Influencer
  • Best Answer
  • February 23, 2022

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

image


jakomies
  • Author
  • February 24, 2022
caracadrian wrote:

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
  • 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+38
  • Influencer
  • February 24, 2022
jakomies wrote:

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
  • February 24, 2022
ebygomm wrote:

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings