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

HANDS-ON (Formulas 101)

How to insert a formula in your report

Click the INSERT FIELDS button on the standard toolbar. The Insert Fields dialog box with the Database Tab active. Click the Formula Tab to activate it.

2 Click the New button.

The Formula Name dialog box appears.

3 Enter the name you want to identify the formula in this edit box.

4 Click OK when finished.

The Formula Editor appears.

338

Seagate Crystal Reports User’s Guide

5 Enter the formula by typing in the components or selecting them from the scroll lists.

$Click the Check button to check the syntax in your formula when finished and fix any syntax errors the Formula Checker identifies.

%When the formula has the correct syntax, click the Accept button to return to the Insert Fields dialog box. Your formula appears in the Formula Name list box.

NOTE: When you click the Accept button, Seagate Crystal Reports

automatically checks the syntax of the formula before allowing you to place it in the report.

&Highlight the formula and click the Insert button to place the formula in your report.

'When you place your cursor over your report, an object frame appears. Click once to set the field in the desired position.

Formulas 101

339

How to delete formulas from your report

Deleting

individual working copies of a formula

Deleting the formula

specification

When you create a formula and add it to your report, Seagate Crystal Reports:

stores the specification for creating the formula, using the name you assigned it, and

places a working copy of that formula at the point you specify in the report. A working copy is any occurrence of the formula in the report.

In order to delete formulas, you must delete the specification and all working copies of the formula.

NOTE: You can not delete the specification without deleting all working copies of the formula.

Select the formula copy you want to delete in your report. Press the Delete key.

NOTE: Even after you have deleted all of the working copies of a formula from your report, the formula specification remains unchanged. The specification is listed in the Formula Tab of the Insert Fields dialog box, and it is available for immediate use should you wish to enter the formula in your report again. Search for Insert Fields dialog box in Seagate Crystal Reports online Help.

NOTE: This step can only be completed after you have deleted all working copies of the formula from your report.

Once you have deleted all working copies of the formula, click the INSERT FIELDS button on the standard toolbar. The Insert Fields dialog box appears with the Database Tab active.

Click the Formula Tab to activate it.

!Highlight the formula specification you want to delete in the

Formula name list.

"Click the Delete button, and the program deletes the formula specification.

340

Seagate Crystal Reports User’s Guide

NOTE: If the formula is being used in another formula the program will delete the specification nonetheless.

NOTE: If you have not deleted all working copies of the selected formula, the program displays the message: Formula Name in use.

It cannot be deleted

How to copy formulas from online Help

Windows allows you to copy text from online Help topics to the Clipboard. You can then paste this text wherever it is needed. Since the formulas you develop using the Formula Editor are simply text, you can save yourself a lot of time by copying useful formulas directly into the Formula Editor and then modifying them to fit your needs.

With the Formula Editor open, activate the online Help in any of the standard ways (Help menu, F1 function key, etc.).

Regardless of the topic that first appears, use the Search or Find facility to locate the topic that contains the formula of interest.

!Scroll through the topic until you locate the formula you want to copy.

"Highlight the formula by dragging the I-beam cursor over it, and choose the Copy command from the Edit menu or press Ctrl-C when finished. Windows puts a copy of the selected text on the Clipboard.

#Place the insertion point where you want the text to appear in the Formula text box of the Formula Editor and press Ctrl-V to paste the text from the Clipboard.

$Modify the formula by changing the fields, formulas, group fields, conditional statements, and text strings as necessary for use with the data used in the new report.

Formulas 101

341

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