Tuesday, March 27, 2012

Excel Export Troubles

I have a local report that I am trying to export to Excel. It uses a stored procedure( SQL 2005) as the data source. The stored procedure runs in 2 seconds and returns about 8000 rows. The export to excel never completes(does work if I limit the number of rows returned). I have set the executionTimeout="36000" in the web.config and set the table adapters Command timeout in the code high enough so that I am not getting timeout errors. The export to PDF works, though takes a few minutes. Looking for any thoughts or ideas on why Excel is so slow.

Here is one idea. Use a SqlDataAdapter and fill a DataSet using your Store Proc then use this free dll to export the DataSet data into CSV file. Excel can easily read the csv and you can format the report in any way you need to.

Here is the link: http://apriendavisualstudio.net/?p=23

Try it, it very simple nothing fancy. It works for me.

Geeked

sql

No comments:

Post a Comment