If you use a DataGrid, you can right click in the bar where the search button is. Click add button → Export to Excel.
Note: you can only use this when your Data Source is Xpath.
You can find more info here: https://docs.mendix.com/refguide/control-bar#export-to-excel-button
With kind regards,
Bryan de Wit