469,623 Members | 1,497 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

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 2041
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.com

"Jason" <c_*******@mighty.co.za> wrote in message
news:Oh**************@TK2MSFTNGP10.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.com> wrote in
message news:OV**************@TK2MSFTNGP09.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.com

"Jason" <c_*******@mighty.co.za> wrote in message
news:Oh**************@TK2MSFTNGP10.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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Eric | last post: by
3 posts views Thread by JacksonYin | last post: by
4 posts views Thread by Hans [DiaGraphIT] | last post: by
3 posts views Thread by Schultz | last post: by
7 posts views Thread by postings | last post: by
3 posts views Thread by Sachin Salgarkar | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.