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

Error when trying to export to excel

When I copy the code you have in your example for exporting the grid to excel, I get the following error:

'GroupingGridExcelConverterControl' is ambiguous in the namespace 'Syncfusion.GroupingGridExcelConverter'.


1 Reply

RS Rajarajeswari S Syncfusion Team July 17, 2008 04:10 AM UTC

Hi Kathy,

Thanks for using Syncfusion products.

Currently, we have the Excel export feature implemented with full support to the auto-formats present in the Grid. Please check out the details below,

. Exporting the data to excel file.
. Exporting the background color of the Grid (when AutoFormat is set) to excel file.
. Exporting the Grouped, Summary columns.
. Excel file, columns and rows can be autofitted.

Please refer the below code snippet which illustrates the above:


GroupingGridExcelConverterControl ggExcelConverter = new GroupingGridExcelConverterControl();
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
IWorkbook myWorkbook = excelEngine.Excel.Workbooks.Create(2);
IWorksheet mySheet = myWorkbook.Worksheets[0];
ggExcelConverter.AutofitColumns = true; // used to Autofit the Excel columns
ggExcelConverter.AutofitRows = true; // used to Autofit the Excel rows
ggExcelConverterGroupingGridToExcel(myWorkbook,this.GridGroupingControl1, mySheet, ConverterOptions.Visible);
myWorkbook.SaveAs("Color.xls",ExcelSaveType.SaveAsXLS,Response,ExcelDownloadType.PromptDialog);


Please refer the sample from the below link which illustrates this:

http://websamples.syncfusion.com/samples/Grid.Web/6.2.0.39/Grid_Web_Excel/main.htm

The above sample is in 6.2.0.39 version, but you can find the modified version of this code present in the "App_Code" directory of the sample. These classes would work with latest version(6.3.0.30) of Essential Studio also.

- Copy the files present under "App_Code" directory of the sample.
- Paste it in your application''s "App_Code" folder.

Once you have the files in your "App_Code" directory of your application, the new classes would be referred. So no need to refer the Syncfusion.GridConverter.Web.dll.


Note:

Please refer the below link to download our latest version 6.3.0.30:

DownLoad Link:

http://www.syncfusion.com/downloads/latestversion/default.aspx

Unlock key:

If your Essential Studio license is current, you will be able to obtain the key to install this version from your account in DirectTrac. Otherwise, please contact your Syncfusion Sales Representative or e-mail salessupport@syncfusion.com .

Please let me know if you have any other concerns.

Regards,
Raji



Loader.
Live Chat Icon For mobile
Up arrow icon