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

master Details View Export Using DataTable Error [Datasource is not ienumerable OR object not set to instance of an object]

Hi,
I am having problem while exporting sfdatagrid with master details view.
I have one dataset which has two tables.I took the sample code which is present in demos.But when i am trying to export to excel it throws error:
posting trace:
System.ArgumentException: source is not IEnumerable<>
   at System.Linq.Queryable.AsQueryable(IEnumerable source)
   at Syncfusion.WinForms.DataGrid.Data.QueryableCollectionViewWrapper..ctor(IEnumerable source, SfDataGrid dataGrid)
   at Syncfusion.WinForms.DataGridConverter.DataGridExportingHelper.CreateCollectionViewAdv(IEnumerable source, SfDataGrid dataGrid)
   at Syncfusion.WinForms.DataGridConverter.DataGridExportingHelper.CreateCollectionView(SfDataGrid dataGrid, Object record, String relationalColumn, IPropertyAccessProvider propertyAccessProvider)
   at Syncfusion.WinForms.DataGridConverter.DataGridToExcelConverter.ExportDetailsViewToExcel(SfDataGrid parentDataGrid, IWorksheet sheet, ExcelExportingOptions excelExportingOptions, Object rec, IPropertyAccessProvider propertyAccessProvider)
   at Syncfusion.WinForms.DataGridConverter.DataGridToExcelConverter.ExportRecordsToExcel(SfDataGrid grid, IWorksheet sheet, ExcelExportingOptions excelExportingOptions, IEnumerable records, IPropertyAccessProvider propertyAccessProvider, Group group)
   at Syncfusion.WinForms.DataGridConverter.DataGridToExcelConverter.ExportToExcelWorksheet(SfDataGrid grid, ICollectionViewAdv view, IWorksheet sheet, ExcelExportingOptions excelExportingOptions)
   at Syncfusion.WinForms.DataGridConverter.DataGridToExcelConverter.ExportToExcel(SfDataGrid grid, ICollectionViewAdv view, ExcelExportingOptions excelExportingOptions)
   at Syncfusion.WinForms.DataGridConverter.DataGridExcelExportExtension.ExportToExcel(SfDataGrid grid, ICollectionViewAdv gridCollectionView, ExcelExportingOptions excelExportingOptions)
   at Ornet.UI.ReportsList.exporttoexcel_Click(Object sender, EventArgs e)

5 Replies

MA Mohanram Anbukkarasu Syncfusion Team December 19, 2018 01:44 PM UTC

Hi Mahendra, 
 
Thanks for contacting Syncfusion support. 
 
We have checked the reported scenario. We can able to reproduce the reported issue in our end and it is confirmed as a defect. We have logged a bug report on this regard. The fix for this issue will be included in our 2018 Volume 4 SP1 release which is expected to be rolled out in the end of January 2019. 
 
Regards, 
Mohanram A. 



MA mahendra June 20, 2019 06:29 AM UTC

Hi I am getting this error while exporting when datasource is Datatable and master details view:

System.ArgumentException: Object of type 'System.Collections.ObjectModel.ObservableCollection`1[Syncfusion.WinForms.DataGrid.GridColumnBase]' cannot be converted to type 'Syncfusion.WinForms.DataGrid.Columns'.
   at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast)
   at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
   at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
   at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Syncfusion.WinForms.DataGridConverter.DataGridToExcelConverter.ExportDetailsViewDataGridToExcel(SfDataGrid sourceDataGrid, ICollectionViewAdv view, IWorksheet sheet, ExcelExportingOptions excelExportingOptions)
   at Syncfusion.WinForms.DataGridConverter.DataGridToExcelConverter.ExportDetailsViewToExcel(SfDataGrid parentDataGrid, IWorksheet sheet, ExcelExportingOptions excelExportingOptions, Object rec, IPropertyAccessProvider propertyAccessProvider)
   at Syncfusion.WinForms.DataGridConverter.DataGridToExcelConverter.ExportRecordsToExcel(SfDataGrid grid, IWorksheet sheet, ExcelExportingOptions excelExportingOptions, IEnumerable records, IPropertyAccessProvider propertyAccessProvider, Group group)
   at Syncfusion.WinForms.DataGridConverter.DataGridToExcelConverter.ExportToExcelWorksheet(SfDataGrid grid, ICollectionViewAdv view, IWorksheet sheet, ExcelExportingOptions excelExportingOptions)
   at Syncfusion.WinForms.DataGridConverter.DataGridToExcelConverter.ExportToExcel(SfDataGrid grid, ICollectionViewAdv view, ExcelExportingOptions excelExportingOptions)
   at Syncfusion.WinForms.DataGridConverter.DataGridExcelExportExtension.ExportToExcel(SfDataGrid grid, ICollectionViewAdv gridCollectionView, ExcelExportingOptions excelExportingOptions)


JP Jagadeesan Pichaimuthu Syncfusion Team June 21, 2019 06:13 AM UTC

Hi Mahendra, 
 
Thanks for using Syncfusion product. 
  
We have analyzed your stack trace, this is the known issue and this issue is fixed in our 2019 Volume 1 SP1 release in 17.1.0.47 Syncfusion version. 
  
  
Could you please upgrade your version to 17.1.0.47 or above? If you need patch, please let us know your product version. We will provide the patch in your product version. 
  
Regards, 
Jagadeesan 



MA mahendra July 18, 2019 11:10 AM UTC

Hi,
Thank You for replying,
As I have been working on 16.4.0.52
so i am little cautious about updating to newer version because there seems to have so many changes in latest versions.
It might break few things which i have build.
Can You help me out with patch.


FP Farjana Parveen Ayubb Syncfusion Team July 19, 2019 10:06 AM UTC

Hi Mahendra, 
  
Thank you contacting Syncfusion support. 
 
We have fixed the reported issue in your version (16.4.0.52). Please find the patch file for this from the below link. 

Recommended approach - exe will perform automatic configuration
Please find the patch setup from below location: 
 

Advanced approach – use only if you have specific needs and can directly replace existing assemblies for your build environment
Please find the patch assemblies alone from below location: 
 
  
Please find Nuget packages from below location :  

Assembly Version: 
16.4.0.52 
Installation Directions:
This patch should replace the files “GridConverter.Windows” under the following folder.
$system drive:\ Files\Syncfusion\Essential Studio\$Version # \precompiledassemblies\$Version#\4.6
Eg : $system drive:\Program Files\Syncfusion\Essential Studio\
16.4.0.52\precompiledassemblies\ 16.4.0.52\4.6

To automatically run the Assembly Manager, please check the Run assembly manager checkbox option while installing the patch. If this option is unchecked, the patch will replace the assemblies in precompiled assemblies’ folder only. Then, you will have to manually copy and paste them to the preferred location or you will have to run the Syncfusion Assembly Manager application (available from the Syncfusion Dashboard, installed as a shortcut in the Application menu) to re-install assemblies.

Note:
You can change how you receive bug fixes by navigating to the following link and updating your preferences.

https://www.syncfusion.com/support/directtrac/patches

Disclaimer:
Please note that we have created this patch for version 
16.4.0.52 specifically to resolve the following issue reported in the forum. 141566

If you have received other patches for the same version for other products, please apply all patches in the order received.  
 
  
Please let us know, if you have any concern. 
 
Regards, 
Farjana Parveen A 


Loader.
Live Chat Icon For mobile
Up arrow icon