Skip to main content
Question

Style Excel cell header / not cell values


Hi all!

I am trying to style the headers of my excel list, based on their name.

With the Excel Styler I figured out how to style several values, using conditional values.

However, what I want is to style headers, not values. How can I define header of column to style? Is it possible?

Thanks in advance!

6 replies

fmelizard
Contributor
Forum|alt.badge.img+17
  • Contributor
  • May 4, 2018

Hi @balcpnar, one way is to use an Excel template to style the headers.


dbaldacchino1
Supporter
Forum|alt.badge.img+11

A template is not an option if you want to write multiple times to the same file. You can only use this if you set the parameters in your writer to overwrite the file. Booo :(


jwarren
Contributor
Forum|alt.badge.img+5
  • Contributor
  • February 16, 2021

The only way I've found to get around this is to write with a featureWriter and then add an attributeCreator to add the field names as attributes for the summery, style them and then write again. Basically you're treating the field names as another dataset. It a proper fudge but I don't see any other way of doing it.


Forum|alt.badge.img
  • June 25, 2021
jwarren wrote:

The only way I've found to get around this is to write with a featureWriter and then add an attributeCreator to add the field names as attributes for the summery, style them and then write again. Basically you're treating the field names as another dataset. It a proper fudge but I don't see any other way of doing it.

Hello

Thanks for your help !

Can you, please, explain in more detail ?


jwarren
Contributor
Forum|alt.badge.img+5
  • Contributor
  • June 25, 2021
machaii wrote:

Hello

Thanks for your help !

Can you, please, explain in more detail ?

Here is demo. It reads an excel file with 3 columns: Name, Age and Address. There is a formatter for the data and then a formatter for the headers.

 

As I've said in the annotations, I’m sure there must be a way of reading in the field name as attributes rather than hardcoding them in with an attribute creator but this did for my purposes. If I do come up with a way I will publish it has transformer so others can use it (I’ve had a quick go, but can’t find out a way to maintain the ordering of the columns).


Forum|alt.badge.img
  • June 28, 2021
machaii wrote:

Hello

Thanks for your help !

Can you, please, explain in more detail ?

Thank you !


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