我试图在 Visual Studio 2008 的报表设计器中显示一个布尔字段。当我尝试运行它时,发生了错误:
"An error has occurred during report processing.
String was not recognized as a valid Boolean."
我尝试使用 CBool() 对其进行转换,但没有成功。
我试图在 Visual Studio 2008 的报表设计器中显示一个布尔字段。当我尝试运行它时,发生了错误:
"An error has occurred during report processing.
String was not recognized as a valid Boolean."
我尝试使用 CBool() 对其进行转换,但没有成功。
=iif(Fields!YourBool.Value, "True", "False")
我错过了什么吗?
I may be mistaken here, but CBool is to convert to boolean. What you probably want is to convert to string so that it can be displayed. However, I'm not sure what the default behaviour would be (i.e. 0/1, true/false, -1/0, Yes/No, etc.) so you could add a function to the code section in the report to display a boolean the exact way you want.
我使用的是 SQL Server 2005。数据类型是位。