TLDR: SSRS gives me an error of:
RunTask: Value cannot be null.
Parameter name: key
I have a BAQ that is a modified version of the stock BAQ named “zHomepage_APAgedPayables”.
My modified BAQ looks like this:
Show BAQ SQL & Phrase Build
with [APInvSchedLastDueDate] as
(select
[APInvSched].[Company] as [APInvSched_Company],
[APInvSched].[VendorNum] as [APInvSched_VendorNum],
[APInvSched].[InvoiceNum] as [APInvSched_InvoiceNum],
(max( APInvSched.PayDueDate )) as [Calculated_LastPaymentDueDate]
from Erp.APInvSched as APInvSched
group by [APInvSched].[Company],
[APInvSched].[VendorNum],
[APInvSched].[InvoiceNum])
select
[APInvHed].[Company] as [APInvHed_Company],
[Vendor].[VendorID] as [Vendor_VendorID],
[Vendor].[Name] as [Vendor_Name],
[Vendor].[GroupCode] as [Vendor_GroupCode],
[VendGrup].[GroupDesc] as [VendGrup_GroupDesc],
[APInvHed].[InvoiceNum] as [APInvHed_InvoiceNum],
[APInvHed].[LegalNumber] as [APInvHed_LegalNumber],
[APInvHed].[PrePayment] as [APInvHed_PrePayment],
[Country].[Description] as [Country_Description],
[APInvHed].[InvoiceDate] as [APInvHed_InvoiceDate],
[APInvHed].[DueDate] as [APInvHed_DueDate],
[APInvHed].[ApplyDate] as [APInvHed_ApplyDate],
[APInvSchedLastDueDate].[Calculated_LastPaymentDueDate] as [Calculated_LastPaymentDueDate],
(CASE
WHEN DATEDIFF(DAY, APInvSchedLastDueDate.Calculated_LastPaymentDueDate, GETDATE()) < 0 THEN APInvHed.InvoiceBal
WHEN DATEDIFF(DAY, APInvSchedLastDueDate.Calculated_LastPaymentDueDate, GETDATE()) = 0 THEN APInvHed.InvoiceBal
ELSE 0
END) as [Calculated_CURRENT],
(CASE
WHEN DATEDIFF(DAY, APInvSchedLastDueDate.Calculated_LastPaymentDueDate, GETDATE()) BETWEEN 1 AND 30 THEN APInvHed.InvoiceBal
ELSE 0
END) as [Calculated_Aged_1_30],
(CASE
WHEN DATEDIFF(DAY, APInvSchedLastDueDate.Calculated_LastPaymentDueDate, GETDATE()) BETWEEN 31 AND 60 THEN APInvHed.InvoiceBal
ELSE 0
END) as [Calculated_Over_30],
(CASE
WHEN DATEDIFF(DAY, APInvSchedLastDueDate.Calculated_LastPaymentDueDate, GETDATE()) BETWEEN 61 AND 90 THEN APInvHed.InvoiceBal
ELSE 0
END) as [Calculated_Over_60],
(CASE
WHEN DATEDIFF(DAY, APInvSchedLastDueDate.Calculated_LastPaymentDueDate, GETDATE()) BETWEEN 91 AND 120 THEN APInvHed.InvoiceBal
ELSE 0
END) as [Calculated_Over_90],
(CASE
WHEN DATEDIFF(DAY, APInvSchedLastDueDate.Calculated_LastPaymentDueDate, GETDATE()) > 120 THEN APInvHed.InvoiceBal
ELSE 0
END) as [Calculated_Over_120],
[VendCnt].[Name] as [VendCnt_Name],
[VendCnt].[PhoneNum] as [VendCnt_PhoneNum],
[APInvHed].[Plant] as [APInvHed_Plant],
[APInvHed].[Plant_c] as [APInvHed_Plant_c]
from Erp.APSyst as APSyst
inner join Erp.AgingRptFmt as AgingRptFmt on
APSyst.Company = AgingRptFmt.Company
and APSyst.FmtCode = AgingRptFmt.FmtCode
inner join Erp.APInvHed as APInvHed on
AgingRptFmt.Company = APInvHed.Company
and ( APInvHed.OpenPayable = true and APInvHed.Posted = true and APInvHed.InvoiceDate <= Constants.Today and APInvHed.InvoiceBal <> 0 )
inner join Erp.Vendor as Vendor on
APInvHed.Company = Vendor.Company
and APInvHed.VendorNum = Vendor.VendorNum
left outer join Erp.Country as Country on
Vendor.Company = Country.Company
and Vendor.CountryNum = Country.CountryNum
left outer join Erp.VendGrup as VendGrup on
Vendor.Company = VendGrup.Company
and Vendor.GroupCode = VendGrup.GroupCode
left outer join Erp.VendorPP as VendorPP on
Vendor.Company = VendorPP.Company
and Vendor.VendorNum = VendorPP.VendorNum
and Vendor.PurPoint = VendorPP.PurPoint
left outer join Erp.VendCnt as VendCnt on
VendorPP.Company = VendCnt.Company
and VendorPP.VendorNum = VendCnt.VendorNum
and VendorPP.PurPoint = VendCnt.PurPoint
and VendorPP.PrimPCon = VendCnt.ConNum
inner join APInvSchedLastDueDate as APInvSchedLastDueDate on
APInvSchedLastDueDate.APInvSched_Company = APInvHed.Company
and APInvSchedLastDueDate.APInvSched_VendorNum = APInvHed.VendorNum
and APInvSchedLastDueDate.APInvSched_InvoiceNum = APInvHed.InvoiceNum
I then tried to create a BAQ Report based off of that BAQ with no filters, no options, no anything. I created a new Report Style under the existing one of APAgng, selected the new Data Definition created by the BAQ Report Designer, added a quick field to display on the RDL for testing, and then tried to Preview the report. It errors out almost instantly and has this error:
Show Error
Program Ice.Services.Lib.RunTask raised an unexpected exception with the following message: RunTask: Value cannot be null.
Parameter name: key
Stack Trace:
at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
at System.Collections.Generic.Dictionary2.FindEntry(TKey key) at System.Collections.Generic.Dictionary
2.TryGetValue(TKey key, TValue& value)
at Epicor.Utilities.DictionaryExtensions.GetOrAdd[TKey,TValue](IDictionary2 dictionary, TKey key, Func
2 valueFactory) in C:_Releases\ICE\ICE3.2.400.0\Source\Shared\Framework\Epicor.ServiceModel\Utilities\DictionaryExtensions.cs:line 24
at Ice.Core.RptBase.ReportDataBuilderBase.XMLDumpTable(IRow row, String rptTableId) in C:_Releases\ICE\ICE3.2.400.22\Source\Server\Internal\Lib\TaskLib\RptBase\ReportDataBuilderBase.cs:line 336
at Erp.Internal.AP.APAgedPayableReport.RunProcess(Int64 instanceTaskNum, String outputFileName) in C:_Releases\ERP\ERP10.2.400.0\Source\Server\Internal\AP\APAgedPayableReport\APAgedPayableReport.cs:line 662
at Ice.Core.TaskBase`1.StartProcess(Int64 instanceTaskNum, String outputFileName) in C:_Releases\ICE\ICE3.2.400.22\Source\Server\Internal\Lib\TaskLib\TaskBase\TaskBase.cs:line 47
at Ice.Hosting.TaskCaller.InnerExecuteTask(IceDataContext newContext) in C:_Releases\ICE\ICE3.2.400.22\Source\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 98
at Ice.Hosting.TaskCaller.ExecuteTask() in C:_Releases\ICE\ICE3.2.400.22\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\ICE3.2.400.0\Source\Server\Services\Lib\RunTask\BpmFriendlyTaskLauncher.cs:line 63
at Ice.Services.Lib.RunTaskSvc.InnerRunTask(Int64 ipTaskNum, Boolean suppressTransaction) in C:_Releases\ICE\ICE3.2.400.0\Source\Server\Services\Lib\RunTask\RunTask.cs:line 592
Not to be defeated, I went and deleted that BAQ Report, and the RDD it created behind the scenes. I then created an RDD using a different name (just to be safe) and added the BAQ to it.
I went back and deleted the RDL, the Report Style, etc., and recreated all of them and tried to run the new report. The same error happens this way as well.
Looking around on the forums here, I have seen a few others with issues similar to this, but no solutions I have found seem to resolve my issue.
I have made BAQ Reports in the past, and have never had any issues. So I am a bit stumped on this one.