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

Couldn''t export grid to excel

Hi,

The following code wasn't able to export the datagrid to excel: Please help me on this issue


GroupingGridExcelConverterControl ggExcelConverter = new GroupingGridExcelConverterControl();
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
IWorkbook myWorkbook = excelEngine.Excel.Workbooks.Add();
IWorksheet mySheet = myWorkbook.Worksheets[0];
this.GridGroupingControl1.Appearance.AnyCell.Font.Size = 10;
ggExcelConverter.GroupingGridToExcel(this.GridGroupingControl1, mySheet, ConverterOptions.Visible);
myWorkbook.SaveAs(this.GridGroupingControl1.TableDescriptor.Name + ".xls", ExcelSaveType.SaveAsXLS, Context.Response, ExcelDownloadType.PromptDialog);
excelEngine.ThrowNotSavedOnDestroy = false;
excelEngine.Dispose();


1 Reply

YG Yavanaarasi G Syncfusion Team June 3, 2008 06:51 AM UTC

Hi Saravana,

Thank you for your interest in Syncfusion products.

I am afraid that I was not able to reproduce the issue. I have created a simple sample with your code snippet and test this issue. Here exporting the grid to excel works fine.

Please refer the sample in the below link:

http://websamples.syncfusion.com/samples/Grid.Web/6.2.0.40/73511/ExportGridtoExcel.Zip

Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample and send us the modified sample so that we could sort out the cause of the issue
and provide you a solution?

Regards,
G.Yavana





Loader.
Live Chat Icon For mobile
Up arrow icon