DataTable to Excel

B

bluewind44

Is there any way to convert Datatables to excel files? (xls, csv)

I got the way to convert Datagrids to excel files
but can't find to convert Datatables to excel files.

plz, help me out.
 
G

Guest

I would create a XSLT that takes the DataTable data and converts it to an
HTML table. You can then easily change the doc type and output as Excel.
Table cells will then render as Excel cells.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
P

Paul Clement

¤ Is there any way to convert Datatables to excel files? (xls, csv)
¤
¤ I got the way to convert Datagrids to excel files
¤ but can't find to convert Datatables to excel files.
¤

Looks like there are several options:

http://tinyurl.com/ccede


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Joined
Aug 28, 2008
Messages
19
Reaction score
0
Covert Data Table To Excel With Format

I have written a class library which does this with one line of code.

The first parameter is the data table, the second one is to include the header or not. The library also has a method call DisplayAndRemoveFile which display the file to user for download after which if it will remove from the temp location. It also has a bunch of other hand util. This is an opensource util which you can look at the code and do further customisation.

QVISLib.Utils.Utils.ConvertDTtoExcel(dt, @"c:\\temp\\dataTable.xls", true);

For more information on the library and download:

connectionstringexamples.com/article.php?story=QVISLib-CHandyLibrary
 
Joined
Jan 25, 2011
Messages
2
Reaction score
0
Free Data Export Component

I want to say that maybe you can try to use some Add-ins. The Add-ins with high quality can make you work more efficiently.
And recently I found the free data export component which can export data to Excel quickly. It is the free version of Spire.DataExport. You can visit E--iceblue.com/Download/download-dataexport-for-net-now.html
to learn more information.
:D
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top