[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3060
  • Last Modified:

The special variable 'Formula' must be assigned a value within the formula

Greetings...I'm new to crystal and trying to execute the following code to color a textbox, but I get "The special variable 'Formula' must be assigned a value within the formula". What can I do to resolve this?

Scott

If {Total}  <  ({Average}/2) Then
    crRed
ElseIf {Total}  >=  ({Average}/2) And {Total}  <  {Average} Then
    crYellow
ElseIf {Total}  >=  {Average} Then
    crGreen
End If
0
rsanglim
Asked:
rsanglim
  • 3
  • 2
  • 2
  • +1
1 Solution
 
rsanglimAuthor Commented:
sorry...v!0 connected to MS SQL 7.0 on Win2k
0
 
vidruCommented:
If you're using Basic syntax in your formulas, you have to explicitly state 'Formula = x':

If {Total}  <  ({Average}/2) Then
   Formula = crRed
ElseIf {Total}  >=  ({Average}/2) And {Total}  <  {Average} Then
    Formula = crYellow
ElseIf {Total}  >=  {Average} Then
    Formula = crGreen
End If

-dave
0
 
bdreed35Commented:
You must have the syntax set to Basic in the drop down in the upper right of the formula workshop.
Change that drop down to Crystal syntax and that should clear up that error.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
rsanglimAuthor Commented:
Thanks, Dave...that looks like it got it...appreciate the quick response!
0
 
rsanglimAuthor Commented:
I was using the Basic syntax, but missed explicitly stating the formula.
0
 
vidruCommented:
Glad to help.

-dave
0
 
Sigh_ManCommented:
If I switch to Basic Syntax and type "Formula = {crBodyText}

the result is "This field name is not known." yet I am pretty sure this field (crBodyText) does exist in the report!
0
 
Sigh_ManCommented:
Sorry - posted to wrong question - PLEASE IGNORE!!    :D
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now