Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

5.09 Setting Bookmarks in Formulas

Setting Bookmarks in Large Formulas

Although it is common for formulas to only have a few lines of code, there are certainly times when you need to write a very complex formula that consists of dozens of lines of code. Of course, a formula this complex will require quite a bit of debugging to make sure it works. When this happens, it is common to be working on one part of the formula and you need to review another part of the formula. For example, you are working with variables derived from multiple calculations and you need to look back at the details of what each calculation does. It can be confusing to scroll back and forth between different parts of the formula without losing track of where you are. Bookmarks make it easy to review different sections of code without losing your place.

Bookmarks let you mark a line of code as important and move to another part of the formula. You can jump back to the bookmark whenever you want. By using two bookmarks, you can toggle back and forth between the two locations with ease. This is a lot easier than scrolling back and forth. The buttons that work with bookmarks are as follows.


The first button sets the bookmark. Clicking it sets the bookmark at the cursor’s current location. The next two buttons jump to either the following bookmark or the previous bookmark. The last button deletes the bookmark. This only works when the cursor is on a line that has an existing bookmark.

Saving Data

After finishing all your hard work, you’ll want to save it. There are two buttons for saving the formula.

The first button saves the formula and closes the Formula Workshop window. The second button only saves it but doesn’t close the Formula Workshop window. This lets you continue working on the formula. The interesting aspect of both of these buttons is that they do more than just save the formula. Prior to saving, they also check the syntax of the formula and alert you to any errors found. You should fix any errors prior to saving the formula. At the end of the chapter we’ll look at the options for debugging report errors.