Directory: First, Formula Components Second, Formula Grammar III, Formula ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------- formula contains two key parts: components and syntax. Components are part of the creation of formulas, and syntax is the rules followed by the organization components. There are several different types of formulas in Crystal Reports: reports, formatted, selected, search, running total conditions, and alert formulas. Most formulas in the report are formulating formulas and conditions. -------------------------------------------------- -------------- One, formulas Create a formula in Crystal Reports Similar to the creation of formulas in any electronic data sheet application. You can use the following components in the formula:
Sample: {Customer. Customer Name}, {Customer. Last year Sales}
Numeral example: 1,2,3.1416
TEXS example: "Quantity", ":", "Your Text"
Operator example: (plus), / (divided), - x (seeking negative)
Operators are operations that can be used in the formula.
Sample example: Round (x) Trim (x)
The function performs the calculation of the average value, summing and counting. List all available functions, which are listed and arranged according to the purpose.
Custom function example: cdfirstdayofmonth, cdstatutoryHolidays
Custom functions provide a way for sharing and reuse formula logic. They can be stored in the Crystal Reserve, which will then be added to the report. Once the custom function is added to the report, the user can use custom functions in Formula Experts when the formula is created.
Control Structure Example: "IF" and "SELECT", "for" cycle
Group Field Value Example: Average (FLD, CONDFLD), SUM (FLD, CONDFLD, "Condition")
Group field values are summarized in groups. For example, group field values can be used to derive a percentage of each group in total.
Other formula Example: {@ Grossprofit}, {@ quota}
See the formula syntax for more information. -------------------------------------------------- -------------- Second, the formula French rules are used to create the correct formula. Some basic rules are:
String text characters in quotation marks. The parameters are enclosed in parentheses (in a suitable location). Quote formula uses the preamble @ symbol identifier. When the Crystal syntax and the Basic syntax are created, you can choose to use the Crystal syntax or Basic syntax. 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.
The Crystal syntax is the formula language included in all versions of Crystal Reports.
If you are familiar with Microsoft Visual Basic or other versions of Basic, you may be more familiar with the Basic syntax. All in all, in addition to specific expansion to handle reports, Basic syntax is model Visual Basic.
If you are accustomed to the Crystal syntax, you can continue to use it and can benefit from new functions, operators, and control structures generated by Visual Basic.
note:
Record the selected and group-selected formulas cannot be written in Basic syntax. Using the Basic syntax does not slow down the process of the report. Reports using the Basic syntax can run on any machine running Crystal Reports. Use the Basic syntax formula without distributing any additional files with the report. Related Topics To learn Basic syntax, see Creating a formula using a Basic syntax. To learn about the Crystal syntax, see Creating a formula using the Crystal syntax. -------------------------------------------------- -------------- Third, the formula type has several different types of formulas in Crystal Reports: report, format, selected, search, running total conditions, and alarm formulas. Most formulas in the report are formulating formulas and conditions.
The report formula report formula is a separate formula created in the report. For example, the formula for calculating the number of days between the order date and the delivery date is a report formula.
Condition formatting formula format formula Changing the layout and design of the report, as well as the appearance of the text, database field, object, or the entire report section. Set the text format by "Format Editor". If you need to create a formula, access the formula studio from the Format Editor. Please refer to the conditional formatting.
Select formulas Selected formulas Specify and limit records and groups that appear in the report. You can enter these formulas directly, or you can use the Select Experts to specify the selected content. Crystal Reports then generates record selection and group selection formulas. You can choose to manually edit these formulas, but you must use the Crystal syntax. See Select Record.
Search formula Search formulas help you locate data in your report. Similar to the selected formula, you don't need to enter these formulas directly, but use the "Search Expert" to specify a search criterion. Crystal Reports generates this formula. You can choose to manually edit these formulas, but you must use the Crystal syntax.
Note: If you already know the Basic syntax, you only need to know a small amount of Crystal syntax, you can modify most selected formulas and search formulas.
Running Total Conditional Formula Running Total Conditions The Formula allows you to define the conditions for running a total of values or reset. See Creating Conditions Running.
Warning Formula Warning formula Helps you define conditions and messages for report alerts. See About report alerts.