Crystal Enterprise generally provides a successful platform for building and delivering reports over the Web. Although successful implementations and wide user adoption are always a good thing, one of the challenges that comes with that is that as more reports get published to the system, it becomes more of a challenge to wade through the mounds of information to quickly find the answers users need. A trend that has recently been growing faster than ever is dashboards. A dashboard is typically a page or series of Web pages that provide a summary of many different measures and metrics defined inside a business. One of the most popular ways to represent information on a dashboard today is in the form of alerts. An alert is a flag that is triggered when a value falls above or below a threshold. Typical examples of this could be headcount rising above a certain number, sales weekly revenue dropping below a certain level, or average call center wait times rising above a preferred level. An alert is defined inside a Crystal Report template and when scheduled, any alerts that are triggered surface themselves through the Crystal Enterprise Object Model. Typically, a user would boot up her computer in the morning and visit the dashboard page to see any alerts that she needs to respond to. This section describes how to provide this list of alerts.
Alerts are triggered during a scheduled report job. This means that when querying for alerts, you should query only report instances. The following query returns the name and corresponding triggered alerts from any report instances that have at least one triggered alert:
SELECT SI_NAME, SI_ALERTS FROM CI_INFOOBJECTS WHERE SI_ALERTS != NULL
The only type of object that can have an alert is a report, so when including a condition like SI_ALERTS != NULL, there is no need to filter on SI_PROGID as well. Figure 36.3 shows the output of the previous query when run in the Query Builder application.
As you can see, the SI_ALERTS property is a hierarchical property. It has a subproperty called SI_NUM_ALERTS and then depending on the number of alerts triggered, it has an SI_ALERT1 property, SI_ALERT2 property, and so on. That property is another hierarchical property that contains the alert name and message in the SI_ALERT_NAME and SI_ALERT_MESSAGE properties, respectively.
One of the things you will find right away is that although there is a way to get all the reports that have run and had alerts triggered, there is no way to determine what alerts are defined on reports that have not been triggered yet. So instead of providing a "triggered/not triggered" type of interface, you can only present a list of alerts that have been triggered. A good way to do this is to simply create a listing called "Alerts of the day" and display the SI_ALERT_MESSAGE value. Because this is attached to an InfoObject, you know the corresponding ID of the report, so it would be a good idea to make the message a hyperlink to the report itself. This enables the user to click on the alert to drill to the detail of what happened.
Also, if a report runs every day you don want duplicate alerts so you would want to filter for any alerts fired that day. Lets say the scheduled reports run at 2 a.m. each morning. You might use the following query to only retrieve the alert for the current day:
SELECT SI_NAME, SI_ALERTS, SI_ENDTIME FROM CI_INFOOBJECTS WHERE SI_ALERTS != NULL AND SI_ENDTIME >= 2004/02/29.2.00
Part I. Crystal Reports Design
Creating and Designing Basic Reports
Selecting and Grouping Data
Filtering, Sorting, and Summarizing Data
Understanding and Implementing Formulas
Implementing Parameters for Dynamic Reporting
Part II. Formatting Crystal Reports
Fundamentals of Report Formatting
Working with Report Sections
Visualizing Your Data with Charts and Maps
Custom Formatting Techniques
Part III. Advanced Crystal Reports Design
Using Cross-Tabs for Summarized Reporting
Using Record Selections and Alerts for Interactive Reporting
Using Subreports and Multi-Pass Reporting
Using Formulas and Custom Functions
Designing Effective Report Templates
Additional Data Sources for Crystal Reports
Multidimensional Reporting Against OLAP Data with Crystal Reports
Part IV. Enterprise Report Design Analytic, Web-based, and Excel Report Design
Introduction to Crystal Repository
Crystal Reports Semantic Layer Business Views
Creating Crystal Analysis Reports
Advanced Crystal Analysis Report Design
Ad-Hoc Application and Excel Plug-in for Ad-Hoc and Analytic Reporting
Part V. Web Report Distribution Using Crystal Enterprise
Introduction to Crystal Enterprise
Using Crystal Enterprise with Web Desktop
Crystal Enterprise Architecture
Planning Considerations When Deploying Crystal Enterprise
Deploying Crystal Enterprise in a Complex Network Environment
Administering and Configuring Crystal Enterprise
Part VI. Customized Report Distribution Using Crystal Reports Components
Java Reporting Components
Crystal Reports .NET Components
COM Reporting Components
Part VII. Customized Report Distribution Using Crystal Enterprise Embedded Edition
Introduction to Crystal Enterprise Embedded Edition
Crystal Enterprise Viewing Reports
Crystal Enterprise Embedded Report Modification and Creation
Part VIII. Customized Report Distribution Using Crystal Enterprise Professional
Introduction to the Crystal Enterprise Professional Object Model
Creating Enterprise Reports Applications with Crystal Enterprise Part I
Creating Enterprise Reporting Applications with Crystal Enterprise Part II
Appendix A. Using Sql Queries In Crystal Reports
Creating Enterprise Reporting Applications with Crystal Enterprise Part II