The GridExcelConverter class provides support for exporting data from a Grid control or Grid Data Bound Grid into an Excel spreadsheet for verification and/or computation. This control automatically copies the Grid's styles and formats to Excel. The GridExcelConverter control is derived from the GridExcelConverterBase. The XlsIO libraries support the conversion of Grid content to Excel.
To make use of the GridExcelConverter class, the following assemblies should be added along with the default assemblies present in the References folder of your application: Syncfusion.GridConverter.Base andSyncfusion.XlsIO.Base.
The GridToExcel method is used to export the grid to an Excel sheet. The following code example illustrates how to convert the Grid content to Excel.
[C#]
Syncfusion.GridExcelConverter.GridExcelConverterControl gecc = new Syncfusion.GridExcelConverter.GridExcelConverterControl(); gecc.GridToExcel(this.gridControl1.Model, @"C:\MyGC.xls"); |
Hi Silvio,
We deeply regret for the delay.
You can change the excel version when export to excel by manually. Please refer to the following code which explains the same.
GridExcelConverterControl gecc = new GridExcelConverterControl();
ExcelEngine engine = new ExcelEngine();
IApplication app = engine.Excel.Application;
app.DefaultVersion = ExcelVersion.Excel2007;
IWorkbook book = app.Workbooks.Create();
gecc.GridToExcel(MyGrid.Model, book.Worksheets[0], ConverterOptions.ColumnHeaders | ConverterOptions.RowHeaders);
Let me know if you have any further concerns.
Regards,
Ragamathullah B.
//Select the version to be saved workbook.Version = ExcelVersion.Excel2010; if (Path.GetExtension(ClaFileDialogHelper.FileName) == excel2003Ext) workbook.Version = ExcelVersion.Excel97to2003;
Hi Silvio,
Please let me know if you have any further concerns.
Regards,
Ragamathullah B.