473,396 Members | 1,771 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,396 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 1269
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Matt | last post by:
I have an ASP page that calls ASP routines that I created that execute a database query and return the results to a recordset. I then iterate through the recordset and display the data in a table....
5
by: Maria L. | last post by:
Hi, I need to export the content of a DataGrid (in Windows application in C#), into an Excel spreadsheet. Anyone knows how to do this? Any code snippets would help! thanks a lot, Maria
2
by: Siu | last post by:
Hi, I use the following code to export and import a file Excel from resp. into a Web page with the following code: //EXPORT Response.Clear(); Response.Buffer = true; Response.ContentType =...
6
by: Elena | last post by:
I'm trying to export data to an Excel worksheet. I can export the data in the cell values perfectly. I need the code to change a header and footer for the worksheet, not for the columns. Is...
13
by: Hemant Sipahimalani | last post by:
The following piece of code is being used to export HTML to excel. HttpContext.Current.Response.ContentType = "application/vnd.ms-excel"...
5
by: Simon | last post by:
Dear reader, With the export command you can export a query to Excel. By activate this command a form pop's up with the following text:
1
by: smaczylo | last post by:
Hello, I've recently been asked to work with Microsoft Access, and while I feel quite comfortable with Excel, I'm at a complete loss with databases. If someone could help me with this issue I'm...
1
by: CoolFactor | last post by:
MY CODE IS NEAR THE BOTTOM I want to export this Access query into Excel using a command button on an Access form in the following way I describe below. Below you will find the simple query I am...
3
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have a question for you. I have a .csv file which has many lines of data. Each line has many data fields which are delimited by ",". Now I need to extract part of data from this...
2
hemantbasva
by: hemantbasva | last post by:
Note We need to have a template on server for generating report in multiple sheet as we do not had msoffice on server moreover this require a batch job to delete excel file created by the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.