Project Description
Exports a DataTable/IEnumerable to Word / Excel / PDF / CSV / HTML / CSV
Can be customized
It's developed in C#

The project exports a Data Table or an IEnumerable of same objects to Word 2003- 2007 / Excel 2003 - 2007 / PDF / XML / HTML
Make extensive use of
  1. String Template - for rendering templates
  2. OfficeSDK for rendering the Word /Excel 2007
  3. itextsharp. for exporting to PDF from XML.

Can be customized because it is based on file templates.

Just download the latest source code from either

1) or

2) Subversion URL: or

3) TFS Server URL:

And then goto ExportDemo\bin\Debug . There you will find ExportDemo.exe . Please ensure that you have write permissions for C: and run ExportDemo.exe . You will find the following files in C:


Now, if you are satisfied with the demo, you can modify the templates to suit your needs and/or modify the source demo ( see Program.cs in ExportDemo)
For your convenience, I will list here
using; // extension methods for data table ...
static void Main(string[] args)
DataTable dta = new DataTable("andrei");
dta.Columns.Add(new DataColumn("ID", typeof(int)));
dta.Columns.Add(new DataColumn("Data", typeof(string)));
dta.Rows.Add(1, "test 1 & <");
dta.Rows.Add(2, "test 2 ");
dta.Rows.Add(3, "test 3 >"); // initial Data

dta.ExportTo(ExportToFormat.Excel2007, @"C:\andrei.xlsx");

dta.ExportTo(ExportToFormat.Word2003XML, @"C:\andrei.doc");

dta.ExportTo(ExportToFormat.Word2007, @"C:\andrei.docx");

dta.ExportTo(ExportToFormat.itextSharpXML, @"C:\aitext.xml");

dta.ExportTo(ExportToFormat.Excel2003XML, @"C:\andrei.xls");

dta.ExportTo(ExportToFormat.HTML, @"C:\andrei.html");

dta.ExportTo(ExportToFormat.XML, @"C:\andrei.xml");

dta.ExportTo(ExportToFormat.PDFtextSharpXML, @"C:\andrei.pdf");

System.Diagnostics.Process.Start("cmd.exe"," /K \"dir c:\\andrei.????\"");


For any improvements wrote to ignatandrei.gif\

You can download the first release

Last edited Jul 23, 2009 at 7:34 AM by ignatandrei, version 8