Formulas
Formulas specifies a new string for an existing formula.
Syntax
[form.]Report.Formulas(ArrayIndex)[= "FormulaName= FormulaText"]
Enter the formula name and the string that you want to replace the existing string for each formula that you want to change in your report.
For example, to change a formula @COMMISSION to {file.SALES}*.1, and a second formula @TOTAL to {file.SALES} + {file.COMMISSION}, enter the following:
CrystalReport1.Formulas(0) = "COMMISSION= {file.SALES} *.1"
CrystalReport1.Formulas(1) = "TOTAL= {file.SALES} + {file.COMMISSION}"
Remarks
- Formulas is an array property that is available at runtime only.
- Use a separate line of code for each formula you want to change.
- Change only those formulas that you want to change.
- The first formula you change must be assigned array index (0), the second must be assigned array index (1), etc.
- The new formula string must conform to Crystal Reports syntax requirements.
- This property is cleared once the print job is printed. If you print a second time, the program reverts to the formulas as originally specified in the report.
Note:
- Spaces are significant in formula names. For this reason, the equals sign must follow the formula name with no intervening spaces.
- The @ sign is not used when designating a formula name in this property.
- You can't use this property to create new formulas. You can only use it to change existing formulas.
Data Type
Array of strings
Availability
Runtime
Related Report Engine Functions
PESetFormula