Visual Studio .NET 2003.NET 1.1ADO.NETWindows 2000Windows XPIntermediateDevVisual StudioWindows.NETC#
DataSet to Excel in Two steps – with Different Styles






3.46/5 (34 votes)
Jul 31, 2005

251965

11342
Cool Component exports DataSet(s) to Excel as Row-wise,Column-wise or Sheet-wise.
Introduction
This component exports a DataSet
to Microsoft Excel. You can also export more than one multiple DataSet
s at a time. This component handles disposing of Excel objects and cleaning up of memory automatically. So there is no worry of memory leakage!! Just two lines of code to export your DataSet to Excel. This is a free component.
Note: You need Excel to be installed in your system.
Different Styles
Different styles that are available are:
- Row Wise: Exports each
DataTable
in theDataSet
in row-wise in Excel. - Column Wise: Exports each
DataTable
in theDataSet
in column-wise in Excel. - Sheet Wise: Exports each
DataTable
in theDataSet
in one worksheet.
Other features and formatting styles
You can set the following:
HeaderForeColor
HeaderBackColor
ItemForeColor
ItemBackColor
ItemAlternateBackColor
FontStyle
RowsSpace
ColumnSpace
TableSpace
Sample Code
Utilities.ExcelExport.Export excel =
new Utilities.ExcelExport.Export();
//Pass your Dataset and Specify the style.
excel.ExportDataToExcel(yourDataSet,
Utilities.ExcelExport.ExportStyle.RowWise);