在Switch中指定DataSet

时间:2012-06-21 19:41:41

标签: ssrs-2008 reporting-services

我的SSRS报告中的文本框中有一个Switch语句,但我有三个数据集,需要指定在交换机中使用哪个数据集。有办法吗?如果是这样我将如何去做呢?

这是我的Switch声明:

=Switch(Fields!ProjectStatus.Value =100000000,"Active", Fields!ProjectStatus.Value = 100000001,"On Hold", Fields!ProjectStatus.Value = 100000002,"Completed", Fields!ProjectStatus.Value = 100000003, "Cancelled", Fields!ProjectStatus.Value = 100000004, "Researching", Fields!ProjectStatus.Value = 100000005, "Wish List", Fields!ProjectStatus.Value = 100000006, "Queued", Fields!ProjectStatus.Value = 100000007, "Redined"))

谢谢!

1 个答案:

答案 0 :(得分:2)

您需要执行某种聚合。通常FIRSTMAX对此有用。

=Switch(First(Fields!ProjectStatus.Value, "Dataset1") =100000000,"Active", First(Fields!ProjectStatus.Value, "Dataset2") = 100000001,"On Hold", First(Fields!ProjectStatus.Value, "Dataset3") = 100000002,"Completed", First(Fields!ProjectStatus.Value, "Dataset1") = 100000003, "Cancelled", First(Fields!ProjectStatus.Value, "Dataset2") = 100000004, "Researching", First(Fields!ProjectStatus.Value, "Dataset3") = 100000005, "Wish List", First(Fields!ProjectStatus.Value, "Dataset1") = 100000006, "Queued", First(Fields!ProjectStatus.Value, "Dataset2") = 100000007, "Redined"))

资源:http://msdn.microsoft.com/en-us/library/ms345237.aspx