com.crystaldecisions.sdk.occa.report.data
Interface IAlert

All Superinterfaces:
IClone
All Known Implementing Classes:
Alert

public interface IAlert
extends IClone

This interface represents an alert contained in a report. This object provides properties for getting information on alerts in the report. Alerts are custom messages that appear when certain conditions are met by data in a report.

An alert may indicate action to be taken by the user or information about report data. Alerts are created from formulas that evaluate conditions you specify. If the condition is true, the alert is triggered and its message is displayed in Crystal Report Writer (CRW) or the Crystal Report viewers. Messages can be text strings or formulas that combine text and report fields. Once an alert is triggered, it is not evaluated again until you refresh your report's data.


Method Summary
 IDataConditionFormula getAlertConditionFormula()
          For internal use only
 IDataConditionFormula getAlertMessageFormula()
          For internal use only
 IFilter getConditionFilter()
           Returns the filter to determine if the alert should be triggered.
 java.lang.String getMessage()
           Returns the default message to display if the alert is triggered.
 IFormulaField getMessageFormula()
           Returns the formula to create the message to display if the alert is triggered.
 java.lang.String getName()
           Returns the name of the alert.
 java.lang.String getTriggeredMessage()
          For internal use only.
 boolean isEnable()
           Returns whether the alert is enabled and can be triggered.
 java.lang.String[] parseMessageFormula()
           Parses the message formula in order to generate a list of message strings.
 void setAlertConditionFormula(IDataConditionFormula oVal)
          For internal use only
 void setAlertMessageFormula(IDataConditionFormula oVal)
          For internal use only
 void setConditionFilter(IFilter oVal)
          Sets the filter to determine if the alert should be triggered.
 void setEnable(boolean bVal)
           Sets whether the alert is enabled and can be triggered.
 void setMessage(java.lang.String sVal)
           Sets the default message to display if the alert is triggered.
 void setMessageFormula(IFormulaField oVal)
          Sets the formula to create the message to display if the alert is triggered.
 void setName(java.lang.String sVal)
           Sets the name of the alert.
 

Method Detail

getConditionFilter

IFilter getConditionFilter()

Returns the filter to determine if the alert should be triggered.

The condition filter's selection formula can be based on recurring records or on summary fields, but cannot be based on print-time fields, such as running totals or print-time formulas.

If an alert filter is based on a summary field, any recurring fields used must be constant over the summary field.

For example, in a "Customer Sales" report in which Last Year's Sales are grouped by Country, Region, and City, you may want to create an alert that is triggered when sales are below a certain limit. You can do this by creating a summary of the field Customer.Last Year's Sales and using the summary type Sum. In this case, your formula can refer to either Country or Region, but not City or Customer Name since these are not constant.

Returns:
The IFilter object.

getAlertConditionFormula

IDataConditionFormula getAlertConditionFormula()
For internal use only


getMessage

java.lang.String getMessage()

Returns the default message to display if the alert is triggered. This is the default message that will be used every time your alert is triggered. If you want your message to be customized with data elements, use IAlert.setAlertMessageFormula(IDataConditionFormula). MessageFormula overrides the values set using IAlert.setMessage(java.lang.String).

Returns:
The message as a String.

getMessageFormula

IFormulaField getMessageFormula()

Returns the formula to create the message to display if the alert is triggered. The result of the formula must be a string, and is created by combining a string with a report field.

For example, if you want to see the message "Country is a star performer" (where Country is the name of a specific country), you might create the following formula: GroupNameField.LongName + " is a star performer." If the MessageFormula is set, it will override the value set using IAlert.setMessage(java.lang.String).

Returns:
The IFormulaField object.

getAlertMessageFormula

IDataConditionFormula getAlertMessageFormula()
For internal use only


getName

java.lang.String getName()

Returns the name of the alert.

Returns:
The name of the alert as a String.

isEnable

boolean isEnable()

Returns whether the alert is enabled and can be triggered.

Returns:
true if the alert is enabled and can be triggered, and false otherwise.

parseMessageFormula

java.lang.String[] parseMessageFormula()

Parses the message formula in order to generate a list of message strings. This method returns an array of strings that can be used in the Java Interactive Viewer's search control.

Returns:
An array of Strings that can be used in the Java Interactive Viewer's search control.

setAlertConditionFormula

void setAlertConditionFormula(IDataConditionFormula oVal)
For internal use only


setConditionFilter

void setConditionFilter(IFilter oVal)

Sets the filter to determine if the alert should be triggered. The condition filter's selection formula can be based on recurring records or on summary fields, but cannot be based on print-time fields, such as running totals or print-time formulas.

If an alert filter is based on a summary field, any recurring fields used must be constant over the summary field.

For example, in a "Customer Sales" report in which Last Year's Sales are grouped by Country, Region, and City, you may want to create an alert that is triggered when sales are below a certain limit. You can do this by creating a summary of the field Customer.Last Year's Sales and using the summary type Sum. In this case, your formula can refer to either Country or Region, but not City or Customer Name since these are not constant.

Parameters:
oVal - The IFilter object.

setEnable

void setEnable(boolean bVal)

Sets whether the alert is enabled and can be triggered.

Parameters:
bVal - true if the alert is enabled and can be triggered, and false otherwise.

setMessage

void setMessage(java.lang.String sVal)

Sets the default message to display if the alert is triggered. This is the default message that will be used every time your alert is triggered. If you want your message to be customized with data elements, use IAlert.setAlertMessageFormula(IDataConditionFormula). Using a message formula overrides the message string set using this method.

Parameters:
sVal - the message to be set.

setAlertMessageFormula

void setAlertMessageFormula(IDataConditionFormula oVal)
For internal use only


setMessageFormula

void setMessageFormula(IFormulaField oVal)

Sets the formula to create the message to display if the alert is triggered. The result of the formula must be a string, and is created by combining a string with a report field.

For example, if you want to see the message "Country is a star performer" (where Country is the name of a specific country), you might create the following formula: GroupNameField.LongName + " is a star performer." If the MessageFormula is set, it will override the value set using IAlert.setMessage(java.lang.String).

Parameters:
oVal - The IFormulaField object.

setName

void setName(java.lang.String sVal)

Sets the name of the alert.

Parameters:
sVal - The name of the alert as a String.

getTriggeredMessage

java.lang.String getTriggeredMessage()
For internal use only.