Adding Alerting to Your Reports

Now that you've learned how to effectively filter the data in your report to show relevant information and ensure peak report performance, let's move on to how to clearly identify the key pieces of information in your report to your end user. Although this can be accomplished by using conditional formatting, there is an alerting feature inside Crystal Reports that allows for more interactive identification of the key data.

A report alert is a custom notification created within Crystal Reports that is triggered when a predetermined condition is met. An alert is comprised of three integral parts:

  • An alert name

  • An alert trigger (condition or threshold)

  • An alert message

Alerts serve the dual functions of bringing end-user attention to a certain condition being met and focusing end-user attention on specifically relevant data in a report thereby increasing user efficiency. Some examples of reports in which alerts could provide a benefit are outlined in Table 15.1.

Table 15.1. Reports with Potentially Useful Alerts

Report

Alert

Alert Trigger and Result

Product Sales Report

Product Profitability Warning

Trigger: Specific product profitability below 10%

   

Result: A listing of the least successfully selling products

Customer Churn Report

Regional Customer Churn Warnings

Trigger: Specific regions where Customer Churn Rate is higher than 3% in a quarter

   

Result: A listing of regions to increase competitive analysis or to review regional management practice

Income Statement

Company Divisions with net losses

Trigger: Company division with net income < 0

   

Result: A listing of divisions where deeper business analysis is required

Report alerts are triggered when the report is processed and the associated condition has been met. Once this condition is true, the alert message will be displayed. Figure 15.3 displays a triggered alert from within the Crystal Reports Designer.

Figure 15.3. A report alert being triggered.

graphics/15fig03.gif

Creating, Editing, and Using Alerts

To create or edit alerts in Crystal Reports, select the Report, Alerts, Create or Modify Alerts menu items. This dialog (shown in Figure 15.4) allows you create a new alert, edit existing alerts, and remove existing alerts.

Figure 15.4. The Create Alerts dialog.

graphics/15fig04.gif

After you have clicked the New Alerts button, the Create Alert dialog pictured in Figure 15.5 is displayed.

Figure 15.5. Creating a new alert.

graphics/15fig05.gif

Use the following steps to create the alert:

  1. Give the alert a name. This name should be meaningful and will be displayed to the user when the alert is triggered.

  2. Specify a condition for which to trigger the alert. An example of this would be: { Customer.Last Year's Sales} < $10000. The condition is simply a formula using either Crystal or Basic syntax that evaluates to a true or false result. True means the alert should be triggered; false means that it should not. (Note: You can use other formulas and parameters inside this condition.) Using a parameter to determine the threshold on your alert is useful because the report could then be viewed by different audiences with different thresholds, and they could still see the alert triggered for their respective numbers.

  3. Give a alert a message to display when the alert has been triggered. This can be a hard-coded string, or can be a formula such as

     "Sales are over $" + ToText({Customer.Last Year's Sales})  

To see your alert in action, refresh the report with data that meets your alert condition, and triggered alerts will be displayed.

Finally, not only are you notified that the alerts have been triggered, you can click the View Records button on the Report Alerts pop-up dialog to filter the report to show only those records that triggered the alert. This is a good way to draw attention to the key outliers in the data.

Using Alerts in Crystal Enterprise

The Report Alerts dialog displayed in Figure 15.3 is only available from within the Crystal Reports Designer. If you are delivering your reports via another mechanism such as the Web, alerts are handled differently. To have your end users take advantage of Crystal Reports alerting, you will need to either use Crystal Enterprise for report distribution or exploit the built-in alert functions (IsAlertEnabled(), IsAlertTriggered(), and AlertMessage()) within formulas you create in your report. For more information on Crystal Enterprise, see Hour 23.



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