Reputation: 35557
The situation is as follows -
Current planned approach:
How does the data get from the database to UserX's client?
I ask because the data sets are quite large and there may be unforeseen problems with certain approaches because of the size. Should the stored procs first move the data to actual server tables, then have a second step and move the data from the server tables into Excel? Or should I just have the stored procedures return the datasets as it will be easy enough to move them direct into XL without any intermediate server tables?
Upvotes: 4
Views: 969
Reputation: 49
If you plan to fetch record thr' c#,
Instead of fetching 10000 or more records one at time, fetch specific no. of records eg 1000, 10 times. That will make process quicker & less memory load.
You don't need to create any intermediate server table to store dataset.
Using DocumentFormat.OpenXml.Spreadsheet in c#, you can write that dataset to Xlsx format or create xml file using System.xml or use thrid party tool/create own excel xml, to create xls format.
Upvotes: 2
Reputation: 11201
I would suggest that you create .csv file from the results returned by your stored procedure at run-time using C#, a .csv file can be opened in Excel so you still have excel as the application at the end
Also please see this link hence i did not recommend you using Automation of Office
Paragraph taken from http://support.microsoft.com/kb/257757 Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
Upvotes: 1