十进制格式在 SSRS 和 XML 作为数据源中不起作用

Decimal Formatting is not working in SSRS and XML as DataSource

我将 WCF 服务作为 SSRS rdl 报告的数据源。因为我为我的其中一列使用了一些十进制格式。但是,输出显示与十进制格式字符串 ("#,#0.00") 完全相同,而不是将格式应用于实际值 (0.00)。

十进制格式

=Format(Fields!Column1.Value,"#,#0.00")

输出

#,#0.00

实际值为 0.00。不明白是什么问题。对此问题的任何帮助将不胜感激。

我觉得你的#太多了。尝试 =Format(Fields!Column1.Value,"#,0.00")

当使用 XML 作为数据源时,默认情况下无法正确识别数据类型。因此,在 SSRS 设计器查询中转换适当的类型 window 可以解决问题。

代码

<Query>
<Method Namespace="http://tempuri.org/" Name="TitlesorItemRec">
</Method>
<SoapAction>http://tempuri.org/IService1/TitlesorItemRec</SoapAction>
<ElementPath IgnoreNamespaces="true">
TitlesorItemRecResponse{}/TitlesorItemRecResult{}/_Pitac{}/PropTitlesorItemRec{Copy (integer),CreatedOn (Date),InfoType, Title,copiesreceipt (integer),itemno,podetailid (integer)}
</ElementPath>
</Query>