我想在Visual Studio 2008的SSRS报表中放置一个子表。我遇到的问题是正确使用功能,并通过我的主要报告引用报告项目。在我的报告中,当主查询返回一个特定的值时,我有一个表示颜色代码的表达式。在我的子表,我想算特定值的每个实例这样的例子:在Visual Studio中的子表中使用聚合函数
Main Report
Supervisor Employee Ranking
Supervisor 1 Employee 1 Meets (Labeled Orange)
Supervisor 1 Employee 2 Outstanding (Labeled Yellow)
Supervisor 2 Employee 3 Meets
Supervisor 2 Employee 4 Meets
Subtable Outstanding Meets
Supervisor 1 1 1
Supervisor 2 0 2
我已经使用下列公式
=count(Reportitems!Ranking.Value, "Meets", 0)
=count(Reportitems!Ranking.Value, "Orange", 0)
=count(Reportitems!Ranking.Value = "Meets")
=count(Reportitems!Ranking.Value = "Orange")
我也改变了=count
到=countrows
和=countdistinct
有人可以帮忙吗?我对任何事都开放,我只想让报告和Subtable正常工作。
“满足”和“杰出”的值来自表达式,而不是来自原始查询的数据集的一部分。有没有办法使用表达式从表达式中提取返回的数据? – dgamboa9999
@ user3216484,我在答案中增加了更多细节。 –
当我把它放在里面时,我收到错误“聚合函数只能在页眉和页脚。“我试图添加列到查询中,但由于我们不断变化的数量和排名,因为收集更多的钱进来,我无法得到它的工作。= iif(字段!KPO.Value是什么,iif(字段!Score.Value> = ReportItems!K_Score.Value,“E”,iif(Fields!Score.Value> = ReportItems!K_Score2.Value,“M”,“OP”)),“OS”)是表达式I用于计算值,但由于需要条件评分,我无法在查询中使用它。 – dgamboa9999