We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

WinForms Grid ->Exporting to Excel 2007 using release 6.3.0.6

Was wondering if anyone could supply some answers to the following question:


Does the Windows Grid in Syncfusion 6.3.0.6 support exporting to Excel 2007 formats? We want to migrate our windows application away from using Excel 2003 to Excel 2007. Updating our version of syncfusion is not currently in project scope.


I am guessing this relates to the following object in the supporting namespace :

GridExcelConverterControl


Would appreciate any documentation/information/limitations.


thanks.


JC

1 Reply

JJ Jisha Joy Syncfusion Team March 31, 2010 08:57 AM UTC

Hi Jeff,

Yes. Essential Studio v6.3.0.6 support export to Excel 2007. To convert the grid content to an Excel 2007, you have to explicitly set the ExcelVersion by creating an XlsIO application and exporting the grid contents to its sheet. See the code:

ExcelEngine engine = new ExcelEngine();
IApplication app = engine.Excel.Application;
app.DefaultVersion = ExcelVersion.Excel2007;
IWorkbook book = app.Workbooks.Create();
GroupingGridExcelConverterControl gecc = new GroupingGridExcelConverterControl();
SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.Filter = 'Files(*.xlsx)|*.xlsx';
saveFileDialog.DefaultExt = '.xlsx';
if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
gecc.GroupingGridToExcel(this.gridGroupingControl1, book.Worksheets[0], ConverterOptions.Visible);
book.SaveAs(saveFileDialog.FileName);
if (MessageBox.Show('Do you wish to open the xls file now?', 'Export to Excel', MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
Process proc = new Process();
proc.StartInfo.FileName = saveFileDialog.FileName;
proc.Start();
}
}

Sample for your reference:

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=ExcelExport833503208.zip

Please let me know if this helps.


Regards,
Jisha

Loader.
Live Chat Icon For mobile
Up arrow icon