Operation Manual

Using Formulas
Creating and modifying formulas
22
430 Crystal Reports User’s Guide
u
To copy a formula from one report to another
1. Select the formula field you want to copy in the report.
2. On the Edit menu, click Copy.
3. Open the report you want to copy the formula to.
4. Choose Paste from the Edit menu.
5. When the program displays the object frame, drag the formula to the new
location.
6. To make changes to the formula, right-click the formula and choose Edit
Formula from the shortcut menu.
The Formula Workshop appears with the Formula Editor active.
7. Delete the old values and type in the new values, or select them from the
Fields, Functions, and/or Operators tree.
8. Click Save and close on the Formula Workshop toolbar when finished.
Key points for editing a copy of a formula
When making changes, use the following points as a guide:
All fields, formulas, and group fields referenced in the formula copy must
actually exist in the new report. This means that any database referenced
in the original formula (or a database with the same structure, field
names, and alias) must be active in the new report.
If such a database is not active, you must change the field, formula, and
group field references in the formula copy to correspond to elements in
your new report.
If the formula contains conditional elements, make certain that the
conditions apply to the data in the new report. For example, if the formula
in your old report performed an action when the quantity was greater than
100, make sure that the greater than 100 condition makes sense in the
new formula. When modifying a formula, you may find that greater than
10 or greater than 2000 makes more sense with your new data.
If you are using the formula with new data, and if your report contains
statements similar to the following:
If {file.FIELD} = "text string"
Make sure that the text strings used in the formula match values that
actually exist in the new data.