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.

4 Likes

I’ve now encountered this error in doing our conversion from 10.1.400 to 10.2.400

The system data definition for the Customer Statement in 10.1 contains a reference to a AUNZ table. This table doesnt exist in 10.2. I assume it is meant to be part of a CSF?

Our Customer statement used a fork of the 10.1 definition which once in the converted 10.2 db refers to a table that doesnt exist! And raises this exception.

We use SSRS not crystal, but definitions are common to both report styles.

1 Like

Yep, got the same error on an upgrade to 10.2.500
Found this wonderful tidbit and made the change (removed the relationship to AUNZ…)

also had to Un-Exclude a couple of fields in the InvcHead (TaxRegioCode and OurBank ) which are used in other relationship keys.
not sure why, but it works

thanks to all the previous posting user for their help.

1 Like