Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

8.11 Report Alerts

Report Alerts

Report alerts prompt the user when certain report data falls within an unacceptable range. For example, report alerts are used to warn the user when inventory quantities fall below a certain level, when sales levels don’t meet a monthly quota, or when customer credit limits have been exceeded. The user has the option of opening a separate tab within the viewer and just seeing the records that triggered the report alert.

Crystal Reports already has an acceptable substitute for report alerts: conditional formatting. With conditional formatting you combine formulas with object properties so that the user can easily see when data is not within an acceptable range. For example, a low inventory quantity can be changed to red and made bold or the top sales person’s name can be shown on a reverse background. There are countless ways to highlight a record so that a user knows that it should be looked at in more detail.

But report alerts have two benefits over conditional formatting. When opening a report, report alerts immediately prompt the user with a message that they should look at certain records and why. In addition to that, they can open a separate tab that only shows the records that triggered the alert. With conditional formatting it isn’t immediately obvious to the user that certain records meet the condition and it’s harder to find those records because they could be buried in the middle of the report.

Viewing Alerts

When the user opens a report which has records that trigger an alert, they are presented with the Report Alerts dialog box, shown in Figure 8-l6.



Figure 8-16. Prompting the user that there are report alerts.

The Report Alerts dialog lists each report alert that was triggered and gives a message describing what it is. The user has the option to view the records that triggered the alert or to close the dialog box and just view the report in its entirety. If the user clicks the View Records button, a new tab opens showing the records that caused the alert.



Figure 8-17. Viewing report alert records.

Since the report alert tab only shows the records that triggered the alert, this is similar to creating a report and using a record selection filter that only shows the bad data. The difference being that with report alerts you have the option of viewing the whole report or just those specific records. When using a record selection formula, you can only view the records that meet the criteria. But don’t think that record selection formulas and report alerts are mutually exclusive. It is perfectly acceptable to have a report that uses a record selection formula and also have report alerts to notify the user of special circumstances.

If you close the alert tab and want to see the alerts again, you can either refresh the report or select the menu items Report > Alerts > Triggered Alerts.

Creating Alerts

Adding and modifying report alerts is a very easy process. To create a new report alert, select the menu items Report > Create > Create or Modify Alerts. This opens the Create Alerts dialog box in Figure 8-18.



Figure 8-18. Managing alerts with the Create Alerts dialog box.

The left side of the dialog box lists the existing report alerts. On the right side are three buttons: New, Edit and Delete. As you might expect, these buttons let you create a new alert, edit an existing alert or delete an alert. When you click the New button, the Create Alert dialog box opens and prompts you for alert name and the alert criteria.



Figure 8-19. Entering a new alert with the Create Alert dialog box.

This dialog box has two input boxes. The first input box is for the alert name. The alert name is shown on the preview tab when the user views the alert report. The second input box is for the message. As you saw in Figure 8-16, the message is what the user is prompted with when they are told that certain records are triggering the alert. This message doesn’t have to be static, as we’ll soon see in one of the tutorials; the Formula Workshop button to the right can be used to customize the message for the user.

The Condition button lets you enter a formula that triggers the report alert. Click on it to open the Formula Workshop dialog box and enter the alert formula. The formula has to return either a Boolean True or False. If a record causes the formula to return True, then it triggers an alert and appears in the alert report.

The Enabled check box toggles whether the alert is in affect. If it is unchecked, then the alert is temporarily disabled until you check the box again.

Click the OK button when you are finished and want to save the alerts.