1

我试图在 Visual Studio 2008 的报表设计器中显示一个布尔字段。当我尝试运行它时,发生了错误:

  "An error has occurred during report processing.
      String was not recognized as a valid Boolean."

我尝试使用 CBool​​() 对其进行转换,但没有成功。

4

3 回答 3

3
=iif(Fields!YourBool.Value, "True", "False") 

我错过了什么吗?

于 2008-10-04T03:39:04.500 回答
1

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.

于 2008-10-01T16:42:02.433 回答
0

我使用的是 SQL Server 2005。数据类型是位。

于 2008-09-30T08:59:28.590 回答