Avg()在c#中返回ReportViewer中的#Error

时间:2015-03-16 06:00:35

标签: reportviewer2008

我有列分组。 在组页脚中,我有这个表达式来给出该组中平均分数。

=Avg(Fields!Score.Value)

当我运行报告时,Average列显示为#Error。

我该如何解决这个问题。 我正在使用C#Winforms,VS2008

它显示警告

Warning:The Value expression for the textbox ‘textbox55’ uses a numeric aggregate function on data that is not numeric.  Numeric aggregate functions (Sum, Avg, StDev, Var, StDevP, and VarP) can only aggregate numeric data. (rsAggregateOfNonNumericData)

最初我通过将Score设置为char(50)来创建表。但现在我在数据库,数据类型中更改为分数十进制。 并且在报告中,Dataset-> perfscoretbl-> Score-> DataType as System.Decimal。

但它仍显示为#Error。

1 个答案:

答案 0 :(得分:0)

我按照这个链接。它现在工作正常。Link