I have a data export screen which is exporting about 30,000 records in one scenario. In this scenario, the data query takes about 2-3 seconds from the database when we run it in SQL, but it's taking 3-7 minutes to generate the Excel file. In my page, I bind the grid when I have the results and the page spins while it generates the Excel file.
I'm generating the excel file from code via:
.rgResults.DataSource = set.Tables;
So I'm binding a data table. The grid is statically on the page. The UI of the grid is generated using AutoGenerateColumns, so I'm using whatever columns are there. Getting the data from the adapter into the table is fast, so that isn't the issue. The issue is the rendering of the data.
Can I speed that up somehow? Or how can I debug this? What might be affecting the slowness? Is it just related to the amount of data?