Skip to main content
I'm experimenting with incorporating Excel workflows into my FME workspaces and am stuck.

 

 

My workspace reads in a raster, then I get raster properties using RasterPropertiesExtractor, then I create a few more attributes with AttributeCreator, and finally I want to write to an Excel file with each attribute name in the first column and its value in the second column.

 

 

I tried many settings under "format parameters" in the excel writer, but with no luck. The main problems I am having is that 1) nothing seems to write to the excel cells no matter what settings I have under "format parameters", and 2) the image of the raster is inserted into the excel file, which I don't know how to stop.

 

 

I'm obviously missing a few things in my first attempt...

 

 

 

Hi,

 

 

1) You will have to configure "User Attributes" of the Excel writer feature type.

 

Right-click on the writer feature type to show the shotcut menu > select "Copy Attributes From Transformer" > select AttributeCreator.

 

Open Feature Type Properties dialog, go to User Attributes page, edit attribute Types etc.

 

Go to Format Parameters page, check "Output Field Names" is set as "Yes" (default).

 

 

2) Try using the GeometryRemover to remove the raster before writing.

 

 

Takashi
Hi Takashi - excellent tips - it almost works as expected:

 

 

1) currently the names are inserted as columns and the values are inserted in the next row. How can I transpose this in FME so that each property name is a new row in the first column and the value be in the next column? Couldn't find any writer format parameters that would do this, do I need an additional transformer

 

2) possibly related to 1) - the output excel table has very very wide columns - is there a way to control this ?
1) The AttributeExploder transformer can be used to transform the feature into multiple features containing pair of attribute (property) name and value. And also maybe you will have to remove features which contain unnecessary attribute names (e.g. fme_***).

 

 

2) You can control width of each column by modifying "Width" in "User Formats" page of the writer feature type.

 


Use atributeexploder.

 

 

1stColumn = @Value(_attr_name)

 

2ndColumn = @Value(_attr_value)

 


Got it working - thanks guys.

 

 

Gio- I tried using your formulas but it results in a red cog in the AttributeExploder (I'm not sure if that is where those formulas are meant to go?)

 


Reply