Sequence does not contain no matching element while running crystal reports

Here is the error im facing while running customized screen based report for AR Invoice

Program Ice.Services.Lib.RunTask raised an unexpected exception with the following message: RunTask: Sequence contains no matching element
Stack Trace:
at System.Linq.Enumerable.First[TSource](IEnumerable1 source, Func2 predicate)
at Ice.Core.RptBase.DataSourceRelationship…ctor(RptRelation rptRelation, IEnumerable1 rptRelationFields, DataSourceCollection dataSources, IEnumerable1 whereItems) in c:_Releases\ICE\RL3.2.300.0\Source\Server\Internal\Lib\TaskLib\RptBase\DataSourceRelationship.cs:line 31
at Ice.Core.RptBase.ReportDefinitionLoader.<>c__DisplayClass11_0.b__0(RptRelation rptRelation) in c:_Releases\ICE\RL3.2.300.0\Source\Server\Internal\Lib\TaskLib\RptBase\ReportDefinitionLoader.cs:line 190
at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext() at System.Linq.Buffer1…ctor(IEnumerable1 source) at System.Linq.OrderedEnumerable1.d__1.MoveNext()
at System.Linq.Buffer1..ctor(IEnumerable1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source) at Ice.Core.RptBase.ReportDefinitionLoader.LoadReport(CachedTables cachedTables, SqlTableSchemaCache sqlTableSchemaCache, Func2 getBaqInformation, IElectronicInterfaceReportingExtender eiReportingExtender, IEnumerable1 extensionTables, String reportParameterTableSystemCode, String reportParameterTableId, String languageFromReportParameter, String languageFromSession, Guid reportInstanceId) in c:\_Releases\ICE\RL3.2.300.0\Source\Server\Internal\Lib\TaskLib\RptBase\ReportDefinitionLoader.cs:line 59 at Ice.Core.RptBase.ReportDefinitionLoader.LoadReport(IRptTask1 rptTask, CachedTables cachedTables, SqlTableSchemaCache sqlTableSchemaCache, IEnumerable1 extensionTables, Func2 getBaqInformation, IElectronicInterfaceReportingExtender eiReportingExtender, Guid reportInstanceId) in c:_Releases\ICE\RL3.2.300.0\Source\Server\Internal\Lib\TaskLib\RptBase\ReportDefinitionLoader.cs:line 24
at Ice.Core.RptTaskBase1.XMLOpen(String fileName) in c:\_Releases\ICE\RL3.2.300.0\Source\Server\Internal\Lib\TaskLib\RptBase\RptTaskBase.cs:line 272 at Erp.Internal.AR.ARInvForm.RunProcess(Int64 instanceTaskNum, String outputFileName) in C:\_Releases\ERP\UD10.2.300.5\Source\Server\Internal\AR\ARInvForm\ARInvForm.cs:line 730 at Ice.Core.TaskBase1.StartProcess(Int64 instanceTaskNum, String outputFileName) in c:_Releases\ICE\RL3.2.300.0\Source\Server\Internal\Lib\TaskLib\TaskBase\TaskBase.cs:line 47
at Ice.Hosting.TaskCaller.InnerExecuteTask(IceDataContext newContext) in C:_Releases\ICE\ICE3.2.300.5\Source\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 98
at Ice.Hosting.TaskCaller.ExecuteTask() in C:_Releases\ICE\ICE3.2.300.5\Source\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 57
at Ice.Lib.RunTask.BpmFriendlyTaskLauncher.Run(String sessionIdPrefix, IceContext db, Action taskRunner) in c:_Releases\ICE\RL3.2.300.0\Source\Server\Services\Lib\RunTask\BpmFriendlyTaskLauncher.cs:line 63
at Ice.Services.Lib.RunTaskSvc.InnerRunTask(Int64 ipTaskNum, Boolean suppressTransaction) in c:_Releases\ICE\RL3.2.300.0\Source\Server\Services\Lib\RunTask\RunTask.cs:line 577

Hello, it’s been a while, but I experienced this same issue and have since drawn a conclusion on what causes this.

Usually, this happens because UDCodes is present in a report relationship on the RDD but is missing from the table list in the RDD. The UDCodes table is likely missing in the RDD in Epicor 10 due to the fact that UDCodes is now a part of the Ice schema.

As a precaution, I delete and re-add all tables and relationships that refer to Ice.

A customer of mine had the same issue with the Customer Statements report after upgrading the epicor version from 10.2.100 to 10.2.400, in case you get the same message (Sequence contains no matching element), it is related to a missing table in one of the relationships. The way to fix it is by removing the relationship with the missing table (it usually has the Child table in blank) or if you have an environment with the previous version review the standard RDD to verify what the original tables and relationships are.