Crystal Reports Log Cryptographic Logical Condition Line

I am currently trying to create a report using Crystal Reports that ships with Visual Studio 2008.

I would like to include in my class a boolean field that shows a string, not true or false. The string must contain either the € sign or the% sign.

How will I do this in the Formula Workshop?

I've tried things like eg.

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

      

However, this never works and results in warnings such as "Formula result must be a number".

It should be pretty simple, but this is my first approach to using Crystal Reports.

Help would be much appreciated.

Jay

+2


a source to share


2 answers


Make sure the SoortKorting field is always true or false. Maybe there is zero, in which case your formula won't work.

Try the following:



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

      

+2


a source


Make sure there is nothing else in the same formula. I usually see this particular error where the formula sometimes returns a string and sometimes a number.

Also, you don't need to test for true, so you can try:



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

      

+1


a source







All Articles