
Introduction
This component exports a DataSet to Microsoft Excel. You can also export more than one multiple DataSets 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 the DataSet in row-wise in Excel.
- Column Wise: Exports each
DataTable in the DataSet in column-wise in Excel.
- Sheet Wise: Exports each
DataTable in the DataSet 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();
excel.ExportDataToExcel(yourDataSet,
Utilities.ExcelExport.ExportStyle.RowWise);