|103922||Jun 8,2012 06:44 AM UTC||Jun 26,2012 10:36 AM UTC||WinForms||3|
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.
Syncfusion.GridExcelConverter.GridExcelConverterControl gecc = new Syncfusion.GridExcelConverter.GridExcelConverterControl();
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, ConverterOptions.ColumnHeaders | ConverterOptions.RowHeaders);
Let me know if you have any further concerns.
//Select the version to be saved workbook.Version = ExcelVersion.Excel2010; if (Path.GetExtension(ClaFileDialogHelper.FileName) == excel2003Ext) workbook.Version = ExcelVersion.Excel97to2003;
Please let me know if you have any further concerns.
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
or the page will be automatically redirected to sign-in page in 10 seconds.