Once you ve created a custom function, either for use in just the current report, or to be shared from the repository, using the function in a formula is easy. You may create a formula that makes use of the function with the Formula Expert (covered in detail in Chapter 5). Or if you create a formula with the Formula Editor, custom functions you ve created in the current report will appear in the Custom Functions category of the function tree.
Custom functions in the repository, however, won t automatically appear in the function tree unless you add them to the report first. To add a repository custom function to the report, expand the Repository Custom Functions category of the Formula Workshop until you find the custom function that you wish to use (you may be prompted to log on to Crystal Enterprise first). Select the function you wish to add and click the Add to Report toolbar button in the Formula Workshop toolbar. You can also right-click the function name in the Formula Workshop tree and choose Add to Report from the pop-up menu. And finally, you may simply drag the custom function you wish to add to the report from the Repository Custom Functions category to the Report Custom Functions category of the Formula Workshop tree.
If the custom function you choose to add to the report calls other custom functions as well (remember, one custom function can call another), you ll be notified that additional custom functions will be added as well. The custom functions will now appear in the Custom Functions category of the function tree for you to add to formulas.