I am able to use the excel export functionality for the tree grid that I am using but I find one minor issue. I see the data correctly exported except for the first Name column where instead of showing the name displayed in view it shows the object name. something like com.test.nat.DataRow@2d1fcace. I am using the tree grid with the IColumnPropertyAccessor providing data for all columns.
This is how I added the excel export option
//Add export to excel option
configRegistry.registerConfigAttribute(ILayerExporter.CONFIG_ATTRIBUTE, new HSSFExcelExporter());
And in the grid export option i tied to a toolbar action
public void ExportToExcel()
natTable.doCommand( new ExportCommand( natTable.getConfigRegistry(), natTable.getShell() ) );
Here is the getDataValue method implementation in IColumnPropertyAccessor
public Object getDataValue( DataRow row, int col )
//System.out.println("col accessor for Row: " + row.getAddress() + "Col: " + col );
if( col == 0 )
value = row.getName();
else if( col == 1 )
value = row.getAge();
value = row.getData( col );
In the plugin view I see the data correctly. The first column shows the DataRow Name value. The problem is only in the exported excel. Is there anything extra that I have to configure for excel export?
Thanks Dirk. Is there an example that I could look at for the IExportFormatter implementation. I looked into the DefaultExportFormatter implementation but I do not understand what I have to do to get the Name column display name in the exported excel. Currently except for the Name Column, all columns display hex values(I have added HexLabels for all those columns and a HexValidator implementation).