Crystal Reports——是否可以通过参数将操作符传递给报表



我似乎找不到解决方案。我一直在Crystal Reports 2011(也在v10中)中玩参数,并想知道是否有可能通过参数将操作符传递给报告。

我已经创建了一个报告,其中显示了各自组中的帐号计数。

GroupName…数

GroupA ................ 5

GroupB ............... 10

GroupC ............... 20

我有一个名为'Val'的参数与计数有关,还有一个名为'Operator'的参数包含不同的操作符(>,<,=等)

在运行时,我希望用户选择运算符和值来缩小他们的结果,但我不能创建一个选择标准,说:

DistinctCount ({customers.account} {customers.type){?operator}{?val}

所以理论上,用户可以输入以下内容(通过参数):

DistinctCount ({customers.account} >= 10

有没有人有什么办法可以做到这一点?另外,如果你需要我没有提供的任何信息,请告诉我。

据我所知,您只能通过长选择记录公式来做到这一点,例如:

Select Case {@Operator}
Case "=" :
    (If (DistinctCount ({customers.account} = 10)) then true else false)
Case ">" :
    (If (DistinctCount ({customers.account} > 10)) then true else false)
Case "<" : 
    (If (DistinctCount ({customers.account} < 10)) then true else false)
Case ">=" :
    (If (DistinctCount ({customers.account} >= 10)) then true else false)
Case "<=" :
    (If (DistinctCount ({customers.account} <= 10)) then true else false)
Default : false

最新更新