You can export a list of objects into Excel with a single line of code by using SimpleExporter class.
This is achieved by using a special built-in template containing GridCommand.
Just create a SimpleExporter instance and run its gridExport method
new SimpleExporter().gridExport(headers, dataObjects, propertyNames, outputStream);
Where
See SimpleExporter example to see it in action.
You may register your own template to be used by SimpleExporter with its registerGridTemplate method.
public void registerGridTemplate(InputStream templateInputStream)
The template must have a GridCommand defined in it.
See SimpleExporter example for an example on how to do it.