无法读取数据集

时间:2016-07-06 19:08:21

标签: sql tsql reporting-services

复杂存储过程填充表格。

然后我从该表中获得了简单的数据集,该数据集在预览模式下显示SSRS报告。但是一旦我将它部署到生产中 - 我得到一个错误说“无法读取数据集的下一个数据行......”

enter image description here 仪表板中的所有报告都很好,除了一个。它一直工作到今天。我不明白我做了什么? 我唯一一次运行存储过程来刷新表中的数据。

;WITH cte_yoyComparison
AS
        (
SELECT  b.YearNum,
        b.MonthNum, 
        b.MonthName,
        ISNULL(SUM(Premium),0) as Premium,
        ISNULL(sum(case when TransactionType IN ('Policy', 'Reinstatement') then 1 ELSE 0 END),0) as Bound

FROM    tblCalendar b  LEFT JOIN Test_Plaza_ProductionReport  a ON b.MonthNum=MONTH(a.EffectiveDate) AND b.YearNum=YEAR(a.EffectiveDate)
WHERE YEAR(EffectiveDate) <> 2017
GROUP BY    b.YearNum, 
            b.MonthName,
            b.MonthNum
            )
SELECT  ISNULL(a.Premium,0) as Premium, 
        c.YearNum,
        c.MonthNum,
        c.MonthName,
        (ISNULL(a.Premium,0) / ISNULL(b.Premium,1))-1 AS Ratio,
        ISNULL(a.Bound,0) as Bound  
FROM tblCalendar c  
    LEFT JOIN cte_yoyComparison a
    ON c.MonthNum=a.MonthNum
    AND c.YearNum=a.YearNum
    LEFT JOIN cte_yoyComparison b
    ON c.MonthNum=b.MonthNum
    AND c.YearNum - 1 = b.YearNum
WHERE
    c.YearNum<>2017
ORDER BY
    c.YearNum DESC
    ,c.MonthNum

第二个SELECT语句中有一些内容会导致该错误。但我不明白什么! 我在代码的乞讨时尝试SET NONCOUNT ON - 没有帮助。 还在报表管理器中尝试将处理选项更改为Do not timeout report - 仍然没有运气!

0 个答案:

没有答案