Formula Extractor

The Formula Expert enables the creation of formulas from existing custom functions. The Formula Extractor enables the exact opposite the creation of custom functions from previously created formulas. This functionality is accessible by creating a new Custom Report Function and selecting the Use Extractor button. Figure 10.23 displays the Extract Custom Function from Formula dialog box accessed when creating custom report functions.

Figure 10.23. The Extract Custom Function from Formula dialog.

graphics/10fig23.jpg

By using the Formula Extractor, it is possible to migrate existing formula logic from a formula field into a custom function. The appropriate part of the migrated formulas can subsequently be replaced with the new custom function and eventually be added to the Crystal Repository.

To create a custom function from an existing formula using the Formula Extractor dialog, follow these steps:

  1. In the Formula Workshop, create a new Custom Report Function. Select the Formula Extractor by clicking on the Use Extractor button after you have ensured that the custom function name you have selected follows your personal or organization's standard naming convention.

  2. Edit the default argument names (v1, v2, and so on) and descriptions that represent the required parameters for the new function. These argument names and descriptions should communicate the expected information to future users of the custom function. The importance of meaningful information here cannot be underestimated with respect to the future usefulness of the newly created custom function.

  3. Add an appropriate summary description to the Summary window so that future report designers using this custom function will understand its proper use.

  4. Click on the Modify Formula to Use New Function check box (lower left area of the Extract Custom Function dialog) to place the new custom function into the formula you are basing it on. This is not a mandatory step, but it is a nice feature that quickly enables you to start to take advantage of the reusability of your new custom function.

  5. Click the Enter More Info button to add additional support information for the custom function. Figure 10.24 displays the More Info dialog.

    Figure 10.24. The Custom Function Enter More Info dialog box.

    graphics/10fig24.jpg

  6. Enter the custom function author (likely yourself) and custom function category information in their respective text boxes.

    graphics/bookpencil_icon.gif

    When entering a custom function category, it is possible to create it at more than one level of subfolder depth by using forward slashes in the Category text box. For example, by entering MapleLeafs/HR, the newly created formula will be added to the Custom Function library under the Maple Leafs category and the HR subfolder. By adding and maintaining your custom functions in a logical hierarchy, future users will find accessing them much easier.


  7. Optionally set default values for your custom functions arguments by clicking on the default value cells and filling in the Default Values dialog box.

  8. Add Help text describing the custom function by clicking on the Help Text button. Again, it is important to consider future report designers using this custom function when deciding on the detail that you should include in this description.



Sams Teach Yourself Crystal Reports 9 in 24 Hours
Sams Teach Yourself Crystal Reports 9 in 24 Hours
ISBN: B003D7JUVW
EAN: N/A
Year: 2005
Pages: 230

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net