DataSet to Excel via OWC

T

tony

Hello,

I have a problem outputting a dataset from a sp to an excel spreadsheet.

I am looping through the dataset and populating the spreadsheet cell by cell.

foreach ( DataRow dr in ds.Tables[0].Rows )
{
iCol = 1;
foreach ( DataColumn dc in ds.Tables[0].Columns )
{
oSheet.Cells[iRow,iCol]= dr[dc.ColumnName].ToString();
iCol++;
}
iRow++;
}

While this works for most of my scenarios, I have a couple of datasets that
take over 15 mins to generate and create a 7 mb spreadsheet.

Question: Is there a faster method of populating the spreadsheet than I am
presently using. I am new to the OWC so any help would be appreciated.

Thanks, Tony




From http://www.developmentnow.com/g/8_2005_6_0_0_0/dotnet-framework-aspnet.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
 
A

Alvin Bruney [MVP - ASP.NET]

There are a number of approaches presented in the black book. One good
approach is to use a stylesheet. Unfortunately, 7mb is really large for the
spreadsheet in general and you may continually experience errors or
significan lag times.

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top