Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
CRW_REF.PDF
Скачиваний:
5
Добавлен:
13.02.2015
Размер:
13.99 Mб
Скачать

How to copy formulas from one report to another

You may find yourself wanting to copy a formula created in one report for use in another report. Copying formulas from one report to another is a simple procedure, but it requires careful attention to detail.

Since formulas are stored as text, it is a simple matter to copy the text formula from one report to another via the Clipboard.

In your report, select the formula field you want to copy.

Choose the COPY command from the Edit menu or press Ctrl- C.

! Open the report you want to copy the formula to.

"Choose the PASTE command from the Edit menu or press Ctrl- V.

#When the program displays the object frame, drag the formula where you want it.

$Change the fields, formulas, group fields, conditional statements, and text strings if necessary for use with the data used in this report.

To make these changes (if necessary), right-click the formula and choose the EDIT FORMULA command from the shortcut menu that appears. The Formula Editor appears.

%Delete the old values and type in the new values, or select them from the Fields, Functions, and/or Operators list boxes. 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.

342

Seagate Crystal Reports User’s Guide

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.

& Click Accept when finished.

Related Topics

HOW TO INSERT FIELDS IN YOUR FORMULA, Page 328

HOW TO INSERT FUNCTIONS IN YOUR FORMULA, Page 329

HOW TO INSERT OPERATORS IN YOUR FORMULA, Page 330

Formulas 101

343

344

Seagate Crystal Reports User’s Guide

14 Advanced Formulas

What you will find in this chapter...

How to create if-then-else formulas, Page 346

How to print Time or dateTime values conditionally, Page 347

How to create multi-condition if-then-else formulas, Page 348

How to format text with formulas, Page 349

How to use variables in formulas, Page 349

How to declare a variable, Page 353

How to assign a value to a variable, Page 354

How to combine a variable declaration and assignment expression, Page 356

How to declare and assign values to multiple variables, Page 357

How to conditionally assign values to variables, Page 357

How to use an array in a formula, Page 358

How to use a range in a formula, Page 361

How to use semicolons in formulas, Page 363

How to fine tune group selection formulas, Page 364

How to fine tune record selection formulas, Page 366

How to debug a formula, Page 370

Advanced Formulas

345

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]