Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: formula equals error Post Reply Post New Topic
Author Message
goodpasture
Newbie
Newbie
Avatar

Joined: 21 May 2009
Location: United States
Online Status: Offline
Posts: 8
Quote goodpasture Replybullet Topic: formula equals error
     Posted: 28 May 2009 at 8:59am
Can anyone please help? I've got the following formula:

If {Lab_Master_.lab_priority} = "R" Then

//Display a checked checkbox
Formula = Chr(254)
Else
//Display empty checkbox
Formula = Chr(168)


and it keeps giving me an error saying a number, ..., string is expected here on Formula.

The R is a string value. I always thought the Formula = is simply a default output but I'm also fairly new to crystal development.

thanks,
JG
IP IP Logged
JohnT
Groupie
Groupie
Avatar

Joined: 20 Jan 2008
Online Status: Offline
Posts: 92
Quote JohnT Replybullet Posted: 28 May 2009 at 9:07am

You need to remove the 'Formula =' text.  You want to return a Chr(254) or a Chr(168).   Crystal syntax would be:

 
If {Lab_Master_.lab_priority} = "R" Then
//Display a checked checkbox
    Chr(254)
Else
//Display empty checkbox
    Chr(168)
IP IP Logged
goodpasture
Newbie
Newbie
Avatar

Joined: 21 May 2009
Location: United States
Online Status: Offline
Posts: 8
Quote goodpasture Replybullet Posted: 28 May 2009 at 9:28am
Thanks ... I read several examples and they had the formula = which I though was just output for crystal.

thanks again ... that worked
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 28 May 2009 at 9:35am
Hi
 
You can code formula in two syntax the formula you were using was in Basic Syntax and John has give you formula in Crystal Syntax ,to make the formula work in Basic Syntax you need to change the value once you are in formula workshop formula editor.
 
Cheers
Rahul
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum