【问题标题】:Error when I use an expression in Report Designer - Visual Studio 2010在报表设计器中使用表达式时出错 - Visual Studio 2010
【发布时间】:2012-04-12 14:12:28
【问题描述】:

在 VS 2010 的报表设计器中,我在 ASP.NET Web 应用程序中设计了一个本地报表 (.rdlc)。在这个报告中,我可以显示数据集的字段(例如:

=Fields!CONTRACT_NO.Value), constants, expressions with constants (="One" & " Two"),

但是当我尝试用字符串连接一个字段时

(="Number " & Fields!AC_TYPE.Value),

报告中显示此字段:#Error。

我尝试将字段显式转换为字符串:="Number " & CStr(Fields!AC_TYPE.Value)

,但我有同样的错误。

提前感谢您的帮助。

【问题讨论】:

    标签: visual-studio-2010 reporting-services string-concatenation


    【解决方案1】:

    出于连接目的,您可以使用+ 符号代替&

    例如:

    =IIf(Fields!Itemamount.Value<0,"("+""+Format(Abs(Fields!Itemamount.Value),"N")+""+")",Format(Fields!Itemamount.Value,"N"))
    

    像这样。

    【讨论】:

      猜你喜欢
      • 2011-02-14
      • 1970-01-01
      • 2023-03-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-29
      • 1970-01-01
      相关资源
      最近更新 更多