What’s the best alternative to export thousands of rows?

I have an application that has many reports. Those reports includes thousands of rows with dozens of columns (too much data). My customers sometimes need to export this data to a .csv file, just to play with it in excel or maybe import it to a Power BI.

As expected, this process takes too long, sometimes they have a time out error.

Which is a good way to afford this UX problem?

My idea is to send an email (asynchronously) with the generated file(s) and even send a notification through the app.

I'm open to any suggestion.

Thanks!