views:

621

answers:

4

I'm trying to display a boolean field in Report Designer in Visual Studio 2008. When I tried to run it, an error occurred:

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

I tried to convert it using CBool() but it didn't work.

A: 

What database are you using? What data type is the field in the database?

Conrad
A: 

I'm using SQL Server 2005. The data type is bit.

Jen
+1  A: 

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.

RiskManager
A: 
=iif(Fields!YourBool.Value, "True", "False") 

Am I missing anything?

roman m