The application I work on is using a Crystal Reports to present reports to the user. I am using Visual 2010, but the report was created by a previous employee some years back using Visual2005. 

The basic setup is that the client application make a request to the server that uses a xsd that define the data-set it sends back. Generally this work like expected, but I am having some problems with evaluating booleans. 

A recent task consider of adding the dataset with a field name TrueWeekday that control if certain numbers should be printed out or not depending on if a date is a regular weekday or have some special local meaning that might affect the sampled data. The data is always used in some formulas so I can not exclude it from the dataset.

My first attempt involved defining the new field as a boolean and in the formula for the report I wrote

```
if {Header.TrueWeekday} then
     CStr({Detail.Flow})
else
     ""

```

This had the result that no matter if the value in TrueWeekday was false or true the flow was presented. I debuged the server to verify that the variable indeed got the expected value so the problem happened in the Crystal Reports or in the transfer of data to Crystal Reports.

To solve this particular problem within the timeconstraints of the task I changed the field to the type string and wrote

```
if {Header.TrueWeekday} = "false" then
     CStr({Detail.Flow})
else
     ""

```

This worked like a charm.

My problem here is not urgent since I have a working solution, but I am worried that this problem might create more subtle dataintrigity problems.

What might be the cause of this and how do I solve it?