reporting-services - 将数字转换为货币时,SSRS 报告显示 #Error
问题描述
我试图让报告显示用户在参数中输入的购买价格。如果用户没有输入任何内容,它将显示“未公开”,否则我希望它以货币形式显示购买价格。我尝试了以下方法:
=IIF(Parameters!PurchasePrice.Value = "", "Undisclosed", Cstr(Format(Parameters!PurchasePrice.Value, "C")))
=IIF(Parameters!PurchasePrice.Value = "", "Undisclosed", Format(Parameters!PurchasePrice.Value, "C"))
=IIF(Parameters!PurchasePrice.Value = "", "Undiscloded", FormatCurrency(Parameters!PurchasePrice.Value,0))
=IIF(Parameters!PurchasePrice.Value = "", "Undiscloded", FormatNumber(Parameters!PurchasePrice.Value,0))
我可以让“未公开”出现,但每次我输入一个数字时它都会显示#Error
解决方案
您可以尝试以下解决方案:
=IIF(IsNumeric(Parameters!PurchasePrice.Value), Format(Val(Parameters!PurchasePrice.Value), "C"), "Undisclosed")
推荐阅读
- android - 使用 Firebase MLkit 库时有没有办法获取 BarCode 格式名称?
- php - 插入带有两个值代码点火器的复选框
- laravel - 当用户仍在laravel中登录时能够访问登录页面
- google-cloud-storage - GCloud 桶存储公共权限异常
- laravel - Auth::attempt 值始终为 false
- kubernetes - 如何为正在运行的服务分配外部 IP 地址?
- saxon - 如何在 S9API 中更改 XdmNode 基本 URI
- php - 显示带有来自 PhP 表单的数据的 HTML 表格
- apache-spark - PySpark UDF 用于转换 UTM 错误预期零参数用于构造 ClassDict(用于 numpy.dtype)
- javascript - 如何在deck.gl的iconlayer中使用svg