473,569 Members | 2,593 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dataset to Excel

Hi

I would like to export a dataset to xml, but not simply writing the XML
equivalent of the dataset. so perhaps call it the true excel file. by
writing the XML equivalent, excel is able to read the file, but not like
proper excel files

Thanks
Jason
Nov 15 '05 #1
2 2196
Jason,

In order to do this, you are going to have to add a reference to the
Microsoft Excel Object library and the Microsoft Office Library (found under
the "COM" tab when you add a reference to your project). Once you have
those, you can create a new instance of your worksheet and then populate the
worksheet from your dataset as you wish, populating each cell with the
appropriate values.

Another option would be to get the dataset as an XML document, then
apply an XSLT on the document so that it conforms to the XML Spreadsheet
specification. The spreadsheet will still be in XML, but its not like XML
imported into a spreadsheet, but rather, the spreadsheet itself is
constructed from the XML.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Jason" <c_*******@migh ty.co.za> wrote in message
news:Oh******** ******@TK2MSFTN GP10.phx.gbl...
Hi

I would like to export a dataset to xml, but not simply writing the XML
equivalent of the dataset. so perhaps call it the true excel file. by
writing the XML equivalent, excel is able to read the file, but not like
proper excel files

Thanks
Jason

Nov 15 '05 #2
Yes it does!

Thanks
Jason

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:OV******** ******@TK2MSFTN GP09.phx.gbl...
Jason,

In order to do this, you are going to have to add a reference to the
Microsoft Excel Object library and the Microsoft Office Library (found under the "COM" tab when you add a reference to your project). Once you have
those, you can create a new instance of your worksheet and then populate the worksheet from your dataset as you wish, populating each cell with the
appropriate values.

Another option would be to get the dataset as an XML document, then
apply an XSLT on the document so that it conforms to the XML Spreadsheet
specification. The spreadsheet will still be in XML, but its not like XML
imported into a spreadsheet, but rather, the spreadsheet itself is
constructed from the XML.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Jason" <c_*******@migh ty.co.za> wrote in message
news:Oh******** ******@TK2MSFTN GP10.phx.gbl...
Hi

I would like to export a dataset to xml, but not simply writing the XML
equivalent of the dataset. so perhaps call it the true excel file. by
writing the XML equivalent, excel is able to read the file, but not like
proper excel files

Thanks
Jason


Nov 15 '05 #3

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

Similar topics

9
8878
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 this out of an XML file or Excel Template file. Next I need to convert a dataset to xml and try and transform this data into the users xml...
2
3597
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, copy/paste the data from other sources or add new records, and then save it as xml. As i have Office XP, that does not work. Is there a freeware XML...
3
19720
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 8.0;"); connection.Open(); OleDbCommand command =new OleDbCommand("SELECT * FROM myRange1", connection);
4
33450
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(); excel.Application.Workbooks.Add(true); DataTable table = DATASETNAME.Tables;
3
2679
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 into a dataset. After the data is stored in the dataset, i would need to write the information to an access db. If it is possible to do this, where...
4
2294
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 table is created then I need to fill the table with the data from that spreadsheet. I am using ASP.NET 2.0 and SQL 2000 for my database. What would...
7
5074
by: postings | last post by:
Hi - can you help please? Please review the following straightforward code which works fine with ordinary XML files. ---------------------------------------------------------------- Dim originalxmlsource As New DataSet Dim xmlfilename As String = Request.PhysicalApplicationPath _ & "myfilename.xml" MyDataGrid.DataSource =...
4
5192
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 advanced. rgds,
1
2625
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 I entered text values and for numeric columns I entered numeric values. It works fine and pass through all the validation checks and gets inserted...
3
2969
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. Is that possible ? I have seen solutions that export a single table to an Excel file. Opening the XML ( DataSet.getXML() ) in Excel is a...
0
7700
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7614
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8125
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7974
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.