Crystal Syntax Overview When you create a formula, you can choose to use the Crystal syntax or the Basic syntax. The grammar rules are used to create the correct formula. Almost any formula written in some syntax can be written in another syntax. The report can include formulas using the Crystal syntax, or formulas using the Basic syntax. For information on creating formulas using the Crystal syntax or using the BASIC syntax, see the formula syntax.
Crystal Syntax Basic Knowledge Formula Formula The value of the formula is placed in the report in the report is called the value returned by the formula. Each formula in Crystal Reports must return a value. For example, the following is a simple Crystal syntax formula, return value 10:
10
The value returned by the formula can be one of the seven simple data types supported. These data types are: numbers, currency, strings, boolean, date, time, and date.
Note: Crystal Reports also supports range types and array types, but the formula cannot return these types.
For example, suppose a company has such a delivery policy, ie the order of orders above more than one thousand dollars can enjoy insurance, while the order below this amount does not have insurance:
/ / Return the formula IF {order of the "string" value. Order amount}> = 1000 Then "Insured Shipping" Else "Regular Shipping"
Tip: The text behind the two antilactors is a comment for others to read this formula, and the Crystal syntax compiler ignores the comment.
If the value of the database field {order. The value of the order amount} is greater than or equal to 1000, then the above formula returns "INSURED SHIPPING"; otherwise returns the text string value "Regular Shipping".