Export the COntent of Dataset or DataTable  to an Xls file

HelpSunny
HelpSunny used Ask the Experts™
on
How to write the content of a Dataset or DataTable to an xls file?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Hello HelpSunny,

Take a look;

Writing Data from a DataTable to Excel
http://msmvps.com/blogs/deborahk/archive/2009/07/23/writing-data-from-a-datatable-to-excel.aspx

Regards,

Rimvis
Commented:
Do you really want an xls-file, or do you want a file that can be opened in Excel and that can hold mulitple sheets and formats? A easy option is to save the data as an XML-file that can be opened with Excel. In the XML-file, you can define styles and formats for your export. Easy to maintain and easy to create.
http://www.codeproject.com/KB/office/excelxmlspreadsheet.aspx has a small sample, but the better option is to save a template-excel file as XML-2003 format and use that as reference. See also attached file.

Book1.xml

Author

Commented:
Thanks for ur reference links, They gave a nice solution

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial