在SSRS中部署后仅加载一个数据集

时间:2017-01-03 01:12:31

标签: ssrs-2008-r2

我在我的SSRS报告中使用了2个数据集。一个用于图表而另一个用于表格。但是在部署之后我一次只能看到一个结果。这意味着一旦表加载图表不加载或如果图表加载表数据不加载。请提出一个好的解决方案。谢谢。请参考以下2个数字。 1.Only chart Loading Here

2.Only Table Loading Here

数据集用于加载表

SELECT distinct STDEV(ORDER_RESULT) AS [Standard Deviation],
(select top 1 MIN from SIVA_ControlLimit  
where VALIDATE_DATE in (@yr) and ITEM_CODE in (@ITEM_CODE) and  TEST_TYPE in (@TEST_TYPE) and BATCH_NO in (@BATCH_NO) and TEST_CASE in (@TEST_CASE) 
order by BATCH_NO,STANDARDVALUE) 'LSL',
(select top 1 MAX from SIVA_ControlLimit 
where VALIDATE_DATE in (@yr) and ITEM_CODE in (@ITEM_CODE) and  TEST_TYPE in (@TEST_TYPE) and BATCH_NO in (@BATCH_NO) and TEST_CASE in (@TEST_CASE) 
order by BATCH_NO,STANDARDVALUE) 'USL',(AVG(ORDER_RESULT)-STDEV(ORDER_RESULT)*3) AS LCL,
AVG(ORDER_RESULT) AS Mean,(AVG(ORDER_RESULT)+STDEV(ORDER_RESULT)*3) AS UCL,
Min(ORDER_RESULT) AS MinOrderResult ,Max(ORDER_RESULT) AS MaxOrderResult 
FROM SIVA_ControlLimit where
VALIDATE_DATE in (@yr) and ITEM_CODE in (@ITEM_CODE) and  TEST_TYPE in (@TEST_TYPE) and BATCH_NO in (@BATCH_NO) and TEST_CASE in (@TEST_CASE)

用于加载图表的数据集

SELECT distinct ORDER_RESULT,BATCH_NO,STDEV(ORDER_RESULT) OVER () AS [Standard Deviation],(select top 1 MIN from SIVA_ControlLimit  where VALIDATE_DATE in (@yr) and ITEM_CODE in (@ITEM_CODE) and 
TEST_TYPE in (@TEST_TYPE) and BATCH_NO in (@BATCH_NO) and TEST_CASE in (@TEST_CASE)  
order by BATCH_NO,STANDARDVALUE) 'LSL',(select top 1 MAX from SIVA_ControlLimit 
where VALIDATE_DATE in (@yr) and ITEM_CODE in (@ITEM_CODE) and  TEST_TYPE in (@TEST_TYPE) and BATCH_NO in (@BATCH_NO) and TEST_CASE in (@TEST_CASE) order by BATCH_NO,STANDARDVALUE) 'USL',
(AVG(ORDER_RESULT) OVER () - STDEV(ORDER_RESULT) OVER ()*3) AS LCL,
AVG(ORDER_RESULT) OVER () AS [CL(AVG)],(AVG(ORDER_RESULT) OVER () + STDEV(ORDER_RESULT) OVER () *3) AS UCL,
Min(ORDER_RESULT) OVER () AS MinOrderResult ,Max(ORDER_RESULT) OVER () AS MaxOrderResult,ROW_NUMBER() OVER (ORDER BY BATCH_NO,ORDER_RESULT) AS Row  
FROM SIVA_ControlLimit where VALIDATE_DATE in (@yr) and ITEM_CODE in (@ITEM_CODE) and  TEST_TYPE in (@TEST_TYPE) and BATCH_NO in (@BATCH_NO) and TEST_CASE in (@TEST_CASE) order by BATCH_NO`

1 个答案:

答案 0 :(得分:0)

听起来你的数据集正在争夺资源。

部署报表时,数据集可以同时运行(同时)。第一个运行是阻止第二个返回数据。在Visual Studio中,数据集一次运行一个,因此您不会看到问题(使调试更有趣)。

由于您似乎对两个数据集使用相同的数据库,因此您可以尝试检查使用单个事务框以强制它们一个接一个地运行。

enter image description here

这种方法的缺点是任何 #TEMP 表都不会在数据集之间自动删除,但这似乎不是您查询中的问题。