I have recently done importing of CSV with dynamic columns for one customer. I used commons-csv API. While working on that, I have seen something related to Excel processing as well.
- Probably you can also do the same with Excel, except you required custom Java development and you must organize your domain model accordingly.
DataGrid by default support export to excel option. You must add a button, which will export all the columns on the datagrid to be exported.
If you want specific export, in specific format, then use Excel export module with relevant templates and configurations.
One thing for sure: It is not possible with the out of box implementations or modules that is available already, which works with templates for import and export.