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()
           Returns the filter to determine if the alert should be triggered.
 IDataConditionFormula getAlertMessageFormula()
           Returns the formula to create the message to display if the alert is triggered.
 IFilter getConditionFilter()
          Deprecated. replaced by getAlertConditionFormula
 java.lang.String getMessage()
           Returns the default message to display if the alert is triggered.
 IFormulaField getMessageFormula()
          Deprecated. replaced by getAlertMessageFormula
 java.lang.String getName()
           Returns the name of the alert.
 Strings getTriggeredMessages(int numOfInstances)
           Returns the triggered messages for the specified maximum number of instances of this alert This method returns an array of strings
 boolean isEnable()
           Returns whether the alert is enabled and can be triggered.
 java.lang.String[] parseMessageFormula()
          Deprecated. replaced by getTriggeredMessages
 void setAlertConditionFormula(IDataConditionFormula oVal)
           Sets the filter to determine if the alert should be triggered.
 void setAlertMessageFormula(IDataConditionFormula oVal)
           Sets the formula to create the message to display if the alert is 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 setName(java.lang.String sVal)
           Sets the name of the alert.
 

Method Detail

getConditionFilter

IFilter getConditionFilter()
Deprecated. replaced by getAlertConditionFormula

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 com.crystaldecisions.sdk.occa.report.data.IFilter object.

getAlertConditionFormula

IDataConditionFormula getAlertConditionFormula()

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 com.crystaldecisions.sdk.occa.report.data.IFilter object.

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 setAlertMessageFormula(IDataConditionFormula). MessageFormula overrides the values set using setMessage(java.lang.String).

Returns:
The message as a String.

getMessageFormula

IFormulaField getMessageFormula()
Deprecated. replaced by getAlertMessageFormula

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 setMessage(java.lang.String).

Returns:
The com.crystaldecisions.sdk.occa.report.data.IFormulaField object.

getAlertMessageFormula

IDataConditionFormula getAlertMessageFormula()

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 setMessage(java.lang.String).

Returns:
The com.crystaldecisions.sdk.occa.report.data.IDataConditionFormula object.

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()
Deprecated. replaced by getTriggeredMessages

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.

getTriggeredMessages

Strings getTriggeredMessages(int numOfInstances)
                             throws ReportSDKException

Returns the triggered messages for the specified maximum number of instances of this alert This method returns an array of strings

Returns:
An array of Strings as the triggered instances of the alerts.
Throws:
ReportSDKException

setAlertConditionFormula

void setAlertConditionFormula(IDataConditionFormula 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 com.crystaldecisions.sdk.occa.report.data.IDataConditionFormula 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 setAlertMessageFormula(IDataConditionFormula) MessageFormula overrides the values set using this method.

Parameters:
sVal - the message to be set.

setAlertMessageFormula

void setAlertMessageFormula(IDataConditionFormula 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 setMessage(java.lang.String).

Parameters:
oVal - The com.crystaldecisions.sdk.occa.report.data.IDataConditionFormula object.

setName

void setName(java.lang.String sVal)

Sets the name of the alert.

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