Question

Excel formatting/styling with Dynamic Schema Definition

  • 22 January 2019
  • 4 replies
  • 6 views

Userlevel 1
Badge +10

Is it possible to set a style for an excel cell if setting attributes dynamically?


4 replies

Userlevel 1
Badge +10

It seems like it should be possible but I'm not having much luck

Badge +2

@egomm you can set the style for a specific cell using the ExcelStyler or using the attribute xlsx_row_formatting. See the Excel documentation on Formatting. If you could include a small example of what you're trying to accomplish then someone might be able to give you more ideas, or we could make improvements to FME if needed.

Userlevel 1
Badge +10

My writer currently looks like this.

The schema source is "Schema From Schema Feature" which is being generated within the workspace as the attributes to write out are generated from the data within the workflow. Adding the attributes into the schema, e.g. colA.formatting doesn't appear to work. I can't set them as attributes in the writer as they need to be dynamic, i.e. if colC exists i want to format it but sometimes col C doesn't exist.

I have a workaround, which uses multiple template files and named ranges, but it's not very elegant.

Badge +7

Seems like this behavior/issue is there still with FME 2022.x.

Reply