0
根据报告参数,我想切换显示的字段。SSRS dynamicaly使用自定义代码选择字段/列
例如一个正常的RS表达应该是这样的
= IIF(Parameters!ReportTypesREPORTTYPEID.Label = 1, Fields!CLIENTGROUP.Value
, IIF(Parameters!ReportTypesREPORTTYPEID.Label = 2, Fields!COSTUNITNUMBER.Value
... etc..
)))
,因为我需要在多个地方(在多个变体)这个代码,我想将它移动到.NET类库。
我已经得到了基本设置为引用类的函数工作:
using System;
using System.Security;
using System.Data.SqlClient;
namespace Reporting_RS_Lib
{
public class Functions
{
public static int GetReportType(int reportTypeId)
{
if (reportTypeId == 0) // will be a case statment
{
return 1;
}
else {
return 2;
}
}
}
}
在if语句,我想引用“字段” -Collection并返回相应列的值。
我需要参考什么来达到上述目的?