By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,369 Members | 1,131 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,369 IT Pros & Developers. It's quick & easy.

Dataset to Excel

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.