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

Error exporting grid to Excel

Hi, we're changing our build process over and we've started getting the following problem when exporting a grid to excel:

Error: Unable to cast object of type 'Syncfusion.Windows.Forms.Grid.Grouping.GridCaptionSection' to type 'Syncfusion.Windows.Forms.Grid.Grouping.GridCaptionRow'.
Component: TraLibrary, Version=1.0.0.53, Culture=neutral, PublicKeyToken=null
Source: Syncfusion.GridConverter.Windows
OS: Microsoft Windows NT 5.2.3790 Service Pack 2

Call Stack:
at Syncfusion.GroupingGridExcelConverter.GroupingGridExcelConverterControl.ExportElements(IList arrElements, IWorksheet sheet, Int32 index, ConverterOptions options, Int32 iGroupLevel)
at Syncfusion.GroupingGridExcelConverter.GroupingGridExcelConverterControl.GroupingGridToExcel(GridGroupingControl grouping, IWorksheet sheet, ConverterOptions options)
at Syncfusion.GroupingGridExcelConverter.GroupingGridExcelConverterControl.GroupingGridToExcel(GridGroupingControl grouping, String strFileName, ConverterOptions options)
at Trafigura.Pluto.Forms.EstimatedCosts.frmEstimatedCosts.ExportToExcel()
at Trafigura.Pluto.Forms.EstimatedCosts.frmEstimatedCosts.ToolBar1_ButtonClick(Object sender, ToolBarButtonClickEventArgs e)

Nothing's changed in the code, so I'm not sure what the issue is. We've had a lot of problems with Syncfusion licence files too (which have largely been resolved), but it doesn't appear to be related. The code to do it is simply:

Dim converter As GroupingGridExcelConverterControl = New GroupingGridExcelConverterControl

converter.GroupingGridToExcel(grdCosts, saveForm.FileName, Syncfusion.GridExcelConverter.ConverterOptions.Default Or Syncfusion.GridExcelConverter.ConverterOptions.Visible Or Syncfusion.GridExcelConverter.ConverterOptions.ColumnHeaders)

Any ideas?

Thanks



4 Replies

GC Grant Crofton September 15, 2010 10:32 AM UTC

Looking further into this, it seems that one of the DLLs involved (Syncfusion.GridConverter.Windows.dll) is different with the new build than with the old one - although it's the same version, it's 4k smaller (48k vs 52k), and doing a binary compare of the assemblies shows differences.

Could it be the new build isn't performing some kind of licencing step which is supposed to upate this DLL to make it work?



JJ Jisha Joy Syncfusion Team September 15, 2010 12:30 PM UTC

Hi Grant,

Could you please let me know the Essential studio version you are using currently?.

Regards,
Jisha



GC Grant Crofton September 16, 2010 12:54 PM UTC

It's Ok, I just replaced the 48k DLl with the 52k one in the build and it works fine now. Not sure what the issue with the DLL was.



JJ Jisha Joy Syncfusion Team September 17, 2010 05:56 AM UTC

Hi Grant,

Glad to know that issue got resolved.

Regards,
Jisha


Loader.
Live Chat Icon For mobile
Up arrow icon