473,382 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

DataSet to Excel via OWC

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_20...ork-aspnet.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Nov 19 '05 #1
1 1484
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
"tony" <no****@developmentnow.com> wrote in message
news:e2**********************************@msnews.m icrosoft.com...
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_20...ork-aspnet.htm

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

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Paul | last post by:
Hi all Arggghhh........... The problem.....I want the user to be able to create an excel document and name particular cells in the document where they want the data to be placed and then save...
2
by: Eric | last post by:
Hi, I am making a flash card type program for the PocketPC. I am using a dataset to contain the cards, all of that works great. I thought I would just import the XML into word or excel,...
3
by: JacksonYin | last post by:
1. I can fill data from Excel to DataSet like this: OleDbConnection connection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=../../Book1.xls;Extended Properties=Excel...
4
by: Hans [DiaGraphIT] | last post by:
Hi! I want to export a dataset to an excel file. I found following code on the net... ( http://www.codeproject.com/csharp/Export.asp ) Excel.ApplicationClass excel = new ApplicationClass();...
3
by: Schultz | last post by:
I would like to know if it is possible to import data from MS Excel 2000 to a dataset using asp.net. The excel file would need to be uploaded to the server from a web page first, before the loaded...
4
by: washoetech | last post by:
Hello, I am working on a project where I need to be able to grab the data from an Excel spreadsheet and create a new table in my database based on the columns in the spreadsheet. After the...
7
by: postings | last post by:
Hi - can you help please? Please review the following straightforward code which works fine with ordinary XML files. ---------------------------------------------------------------- Dim...
4
by: Phoebe. | last post by:
Hi, Good Day! Reading 1 excel file into a dataset is fine. How can I read multiple excel with the same data structure into 1 dataset? How can I append those data? Can someone help? Thanks in...
1
by: Ramakrishnan Nagarajan | last post by:
Hi, I am converting Excel data into a Dataset in C#. There are around 24 columns in the Excel Sheet. First I tried to insert one row with correct values in the Excel sheet. i.e. for text columns...
3
by: Sachin Salgarkar | last post by:
I have a DataSet that I need to export to Excel. The dataset has multiple tables. I need a way to export the complete dataset to a single Excel Workbook with sheets for each table in the dataset....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.