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

Userlevel 4
Badge +13

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

Badge +3

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 :(

Badge +4

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.

Badge

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 ?

Badge +4

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).

Badge

Hello

Thanks for your help !

Can you, please, explain in more detail ?

Thank you !

Reply