Skip to main content
Solved

ExcelStyler - Conditional background formatting based on value of another cell


tsirkuse
Participant

I would like to color the cells of my first column ID_WS based on the text value contained in a cell UPDATE_STATUS which basically contains the fme_db_operation value.

I tried to apply the styling with ExcellFormater but it doesn't seem to be working in the output.

What am I doing wrong here ? Thank you !

Best answer by ebygomm

The excel styer should be creating an attribute called ID_WS.formatting, this needs to be written out as an attribute for the styling to work. I don't see it included on your writer in the image you posted.

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

8 replies

xiaomengatsafe
Safer
Forum|alt.badge.img+3

Hi @tsirkuse, what version of FME are you using? In 2019, when you are configuring the Parameter Condition Definition, you can pick the colour using the ... button. This will give you the right values to represent your chosen colour. In my test this works as expected.

Hope this helps.

Xiaomeng


tsirkuse
Participant
  • Author
  • Participant
  • April 16, 2019
xiaomengatsafe wrote:

Hi @tsirkuse, what version of FME are you using? In 2019, when you are configuring the Parameter Condition Definition, you can pick the colour using the ... button. This will give you the right values to represent your chosen colour. In my test this works as expected.

Hope this helps.

Xiaomeng

Hello,

 

I am using 2018.1 and I have been using the button to select the color, yet I don't get any color formatting on my output excell sheet.

Any ideas ?

Thanks

 


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • Best Answer
  • April 16, 2019

The excel styer should be creating an attribute called ID_WS.formatting, this needs to be written out as an attribute for the styling to work. I don't see it included on your writer in the image you posted.


tsirkuse
Participant
  • Author
  • Participant
  • April 16, 2019
ebygomm wrote:

The excel styer should be creating an attribute called ID_WS.formatting, this needs to be written out as an attribute for the styling to work. I don't see it included on your writer in the image you posted.

Hello,

 

The attribute is written out in the styler but not in the writter. This matches an example I found on the safe website

 

 

I tried connecting the ID_WS.formatting to a format attribute in the writer but this creates an error in Excel on opening the document.

 

 

 

Example :


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • April 16, 2019
tsirkuse wrote:

Hello,

 

The attribute is written out in the styler but not in the writter. This matches an example I found on the safe website

 

 

I tried connecting the ID_WS.formatting to a format attribute in the writer but this creates an error in Excel on opening the document.

 

 

 

Example :

The attribute on the writer needs to be called ID_WS.formatting, it is set as a user attribute not a format attribute.

An example which creates 10 features, which are then styled depending on whether they are odd or even. Written out to one sheet with the ID.formatting attribute and the other sheet without

excel_apply_format.fmw


tsirkuse
Participant
  • Author
  • Participant
  • April 16, 2019
ebygomm wrote:

The attribute on the writer needs to be called ID_WS.formatting, it is set as a user attribute not a format attribute.

An example which creates 10 features, which are then styled depending on whether they are odd or even. Written out to one sheet with the ID.formatting attribute and the other sheet without

excel_apply_format.fmw

Hello,

 

The formatter seems to work only when applying the formatting to the same cell the value is used conditional for.

 

Whenever I try to style ID_WS based on another column, it fails.

 

Thank you

tsirkuse
Participant
  • Author
  • Participant
  • April 16, 2019
xiaomengatsafe wrote:

Hi @tsirkuse, what version of FME are you using? In 2019, when you are configuring the Parameter Condition Definition, you can pick the colour using the ... button. This will give you the right values to represent your chosen colour. In my test this works as expected.

Hope this helps.

Xiaomeng

@xiaomengatsafe the styler seems to work only when basing formatting on values of the same cell/attribute/feature. If I am trying to style my first column based on a value in another column, it doesn't work.


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • April 16, 2019
tsirkuse wrote:
Hello,

 

The formatter seems to work only when applying the formatting to the same cell the value is used conditional for.

 

Whenever I try to style ID_WS based on another column, it fails.

 

Thank you

I don't see the same behaviour. If i change the excelstyler to style a second_column based on the ID column it works

excel_apply_format.fmw


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