471,872 Members | 1,392 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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 2089
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
NeoPa
reply views Thread by NeoPa | last post: by
aboka
reply views Thread by aboka | 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.