Hi Jeff,
To meet your requirement, you can use the Data Grid 2 widget in Mendix. It comes with a built-in column visibility toggle (the eye icon) that lets users show or hide columns as needed. When exporting to Excel, only the columns that are currently visible (selected via the toggle) will be included in the export.
You can use the built-in JavaScript action, Export_To_Excel , which comes with DataWidgets to export the data.
Hope it helps!
Thanks