Crystal Reports Formula Workshop boolean condition to string

I'm currently trying to create a report using Crystal Reports that comes with Visual Studio 2008.

I would like to include a field of type boolean on my report that shows a string rather than true or false. The string should contain either contain a € or a % sign.

How would I go about doing this in the Formula Workshop?

I've tried things like e.g.

if {tblAankoopDetails.SoortKorting} = true then "€" else "%"

However this never seems to work and results in warnings such as "The formula result must be a number".

This should be fairly simple but this is my first go at using Crystal Reports.

Help would be much appreciated.

Jay

Answers


Make sure your SoortKorting field has always true or false. Maybe there's a null and in that case your formula will not work.

Try with this:

if isnull({tblAankoopDetails.SoortKorting}  ) then 
" "
else
    if {tblAankoopDetails.SoortKorting} =true 
    then "€" else "%"

Make sure there is nothing else in the same formula. Usually I see that particular error when a formula sometimes returns a string, and sometimes a number.

Also, you shouldn't need to test for true, so you might try:

if {tblAankoopDetails.SoortKorting} then "€" else "%"

Need Your Help

Mysql limit insert/update/delete to being called from trigger (Not from application code)

mysql sql triggers innodb

My use case is that I have a MYSQL table which has a change tracking table behind it. Both tables are InnoDB.

Urllib2.urlopen and request freezes

python python-2.7 web get httprequest

Edit:I have found that i made a mistake, because the cause of the error wasn't urllib but nltk, which wasn't able to process a long string which came from this exact page. Sorry for this one.