Jen
Jen

Reputation: 153

Display Boolean Field in Visual Studio Report Designer

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.

Upvotes: 1

Views: 3566

Answers (3)

roman m
roman m

Reputation: 26561

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

Am I missing anything?

Upvotes: 3

RiskManager
RiskManager

Reputation: 88

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.

Upvotes: 1

Jen
Jen

Reputation: 153

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

Upvotes: 0

Related Questions