471,348 Members | 1,195 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Export to excel

I need to export into excel but not into a new worksheet each time.I
want to add the exported dataset onto an existing spreadsheet that
already has rows on it. I may have not written this to well. Please
any suggestions. Thanks
Jun 27 '08 #1
3 1199
Cdude pisze:
I need to export into excel but not into a new worksheet each time.I
want to add the exported dataset onto an existing spreadsheet that
already has rows on it. I may have not written this to well. Please
any suggestions. Thanks
The general idea is to use OLE DB provider with Microsoft Jet engine
which is capable of performing some SQL statements on Excel workbooks.
To make a long story short: first you must create a "table" in Excel
with CREATE TABLE statement (it will create a worksheet) and then you
can use regular INSERT statements to add new rows to the table, which
effectively will add rows to existing worksheet.

This article should help:

http://support.microsoft.com/kb/316934

--
Marcin Hoppe
Email: ma**********@gmail.com
Blog: http://devlicio.us/blogs/marcin_hoppe
Jun 27 '08 #2
"Cdude" <ca*******@yahoo.comwrote in message
news:f0**********************************@a23g2000 hsc.googlegroups.com...
I need to export into excel but not into a new worksheet each time.I
want to add the exported dataset onto an existing spreadsheet that
already has rows on it. I may have not written this to well. Please
any suggestions. Thanks
Marcin's reply will work well if you need to add only basic data to the
existing Excel spreadsheet. However, if you need anything more than this
(e.g. formatting, formulas etc), then you could use Office Automation via
COM / Interop. However, this would require a copy of Excel installed on the
same machine as your C# app.

Alternatively, this will do what you require without a copy of Excel:
http://www.aspose.com/categories/fil...a/default.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #3
On May 5, 8:55 am, Cdude <camelj...@yahoo.comwrote:
I need to export into excel but not into a new worksheet each time.I
want to add the exported dataset onto an existing spreadsheet that
already has rows on it. I may have not written this to well. Please
any suggestions. Thanks
Probably the best way to do it is to use some of the third party
component. I can recommend you GemBox.Spreadsheet .NET component. You
can find an example of exporting to dataset at: http://www.gemboxsoftware.com/LDataSet.htm.

--
Mario
GemBox.Spreadsheet for .NET - Easily read and write Excel (XLS, XLSX
or CSV) files or export to HTML files from your .NET apps. See
http://www.gemboxsoftware.com/GBSpreadsheet.htm
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Matt | last post: by
6 posts views Thread by Elena | last post: by
13 posts views Thread by Hemant Sipahimalani | last post: by
5 posts views Thread by Simon | last post: by
3 posts views Thread by =?Utf-8?B?YzY3NjIyOA==?= | last post: by
1 post views Thread by Ronak mishra | last post: by

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.