It is possible to use separately the export functionality to MSExcel provided by DataGridView Extension. There are some simple steps outlined below you have to follow.
1. Add reference to the main assembly ‘DataGridViewExtension.dll’ and export dll ‘DGVEExcelExporting.dll’. The assemblies can be found in folder 'v1.1.1\Bin' in the installation\archive.
2. First ensure you have the following imports:
C#
using CompletIT.Windows.Forms.Export.Excel;
VB.NET
Imports CompletIT.Windows.Forms.Export.Excel
3. Then add the following code in the event handler that has to perform the export:
C#
DGVEExcelExportSettings exportSettings = new DGVEExcelExportSettings();
exportSettings.ExportFileName = ...//Export file name
exportSettings.OpenFileAfterGeneration = true; //Open generated file after export
//Set other settings here...
DGVEExcelExporter exporter = new DGVEExcelExporter();
exporter.Export( dataGridView, exportSettings );
VB.NET
Dim ExportSettings As DGVEExcelExportSettings = New DGVEExcelExportSettings()
ExportSettings.ExportFileName = ...'Export file name
ExportSettings.OpenFileAfterGeneration = True 'Open generated file after export
'Set other settings here...
Dim Exporter As DGVEExcelExporter = New DGVEExcelExporter()
Exporter.Export(Me.DataGridViewControl, ExportSettings)
4. Run your application!