com.crystaldecisions.sdk.occa.report.data
Class Alert

java.lang.Object
  extended by com.crystaldecisions.sdk.occa.report.data.Alert
All Implemented Interfaces:
IAlert, IClone

public class Alert
extends java.lang.Object
implements IAlert

This object represents an alert contained in a report. When possible use the IAlert interface. 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.

For more information, see Report Alerts in the Crystal Reports online help.


Constructor Summary
Alert()
           
Alert(IAlert src)
           
 
Method Summary
 java.lang.Object clone(boolean deepClone)
           
 void copyTo(java.lang.Object destObject, boolean deepCopy)
           
 java.lang.Object createMember(java.lang.String eleName, org.xml.sax.Attributes attrs, com.crystaldecisions.xml.serialization.XMLSerializationContext ctxt, java.util.Map objState, boolean[] bLoaded)
          For internal use only.
 void doControllerModification(java.lang.Object newObject)
           
 void endElement(java.lang.String eleName, java.util.Map objState)
          For internal use only.
 void enumerateMembers(IMemberVisitor visitor)
           
 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
 ControllableMixin getControllableMixin()
           
 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 hasContent(java.lang.Object obj)
           
 void internalSetTriggeredMessages(Strings messages)
          Deprecated.  
 boolean isDirectlyControllable()
           
 boolean isEnable()
           Returns whether the alert is enabled and can be triggered.
 java.lang.String[] parseMessageFormula()
          Deprecated. replaced by getTriggeredMessages
 void readElement(java.lang.String eleName, java.lang.String sVal, org.xml.sax.Attributes attrs, java.util.Map objState)
          For internal use only.
 void save(com.crystaldecisions.xml.serialization.XMLWriter writer, com.crystaldecisions.xml.serialization.XMLSerializationContext ctxt)
          For internal use only.
 void save(com.crystaldecisions.xml.serialization.XMLWriter writer, java.lang.String sTag, com.crystaldecisions.xml.serialization.XMLSerializationContext ctxt)
          For internal use only.
 void saveContents(com.crystaldecisions.xml.serialization.XMLWriter writer, com.crystaldecisions.xml.serialization.XMLSerializationContext ctxt)
          For internal use only.
 void setAlertConditionFormula(IDataConditionFormula newConditionFormula)
           Sets the filter to determine if the alert should be triggered.
 void setAlertMessageFormula(IDataConditionFormula newMessageFormula)
           Sets the formula to create the message to display if the alert is triggered.
 void setEnable(boolean newEnable)
           Sets whether the alert is enabled and can be triggered.
 void setMessage(java.lang.String newMessage)
           Sets the default message to display if the alert is triggered.
 void setName(java.lang.String newName)
           Sets the name of the alert.
 void startElement(java.lang.String eleName, java.util.Map objState, org.xml.sax.Attributes attrs)
          For internal use only.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Alert

public Alert(IAlert src)

Alert

public Alert()
Method Detail

clone

public java.lang.Object clone(boolean deepClone)

copyTo

public void copyTo(java.lang.Object destObject,
                   boolean deepCopy)

createMember

public java.lang.Object createMember(java.lang.String eleName,
                                     org.xml.sax.Attributes attrs,
                                     com.crystaldecisions.xml.serialization.XMLSerializationContext ctxt,
                                     java.util.Map objState,
                                     boolean[] bLoaded)

For internal use only.


endElement

public void endElement(java.lang.String eleName,
                       java.util.Map objState)

For internal use only.


getConditionFilter

public IFilter getConditionFilter()
Deprecated. replaced by getAlertConditionFormula

Description copied from interface: IAlert

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.

Specified by:
getConditionFilter in interface IAlert
Returns:
The com.crystaldecisions.sdk.occa.report.data.IFilter object.

getAlertConditionFormula

public IDataConditionFormula getAlertConditionFormula()
Description copied from interface: IAlert

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.

Specified by:
getAlertConditionFormula in interface IAlert
Returns:
The com.crystaldecisions.sdk.occa.report.data.IFilter object.

getMessage

public java.lang.String getMessage()
Description copied from interface: IAlert

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).

Specified by:
getMessage in interface IAlert
Returns:
The message as a String.

getMessageFormula

public IFormulaField getMessageFormula()
Deprecated. replaced by getAlertMessageFormula

Description copied from interface: IAlert

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).

Specified by:
getMessageFormula in interface IAlert
Returns:
The com.crystaldecisions.sdk.occa.report.data.IFormulaField object.

getAlertMessageFormula

public IDataConditionFormula getAlertMessageFormula()
Description copied from interface: IAlert

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).

Specified by:
getAlertMessageFormula in interface IAlert
Returns:
The com.crystaldecisions.sdk.occa.report.data.IDataConditionFormula object.

getName

public java.lang.String getName()
Description copied from interface: IAlert

Returns the name of the alert.

Specified by:
getName in interface IAlert
Returns:
The name of the alert as a String.

hasContent

public boolean hasContent(java.lang.Object obj)

isEnable

public boolean isEnable()
Description copied from interface: IAlert

Returns whether the alert is enabled and can be triggered.

Specified by:
isEnable in interface IAlert
Returns:
true if the alert is enabled and can be triggered, and false otherwise.

parseMessageFormula

public java.lang.String[] parseMessageFormula()
Deprecated. replaced by getTriggeredMessages

Description copied from interface: IAlert

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.

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

readElement

public void readElement(java.lang.String eleName,
                        java.lang.String sVal,
                        org.xml.sax.Attributes attrs,
                        java.util.Map objState)

For internal use only.


save

public void save(com.crystaldecisions.xml.serialization.XMLWriter writer,
                 com.crystaldecisions.xml.serialization.XMLSerializationContext ctxt)
          throws java.io.IOException

For internal use only.

Throws:
java.io.IOException

save

public void save(com.crystaldecisions.xml.serialization.XMLWriter writer,
                 java.lang.String sTag,
                 com.crystaldecisions.xml.serialization.XMLSerializationContext ctxt)
          throws java.io.IOException

For internal use only.

Throws:
java.io.IOException

saveContents

public void saveContents(com.crystaldecisions.xml.serialization.XMLWriter writer,
                         com.crystaldecisions.xml.serialization.XMLSerializationContext ctxt)
                  throws java.io.IOException

For internal use only.

Throws:
java.io.IOException

setAlertConditionFormula

public void setAlertConditionFormula(IDataConditionFormula newConditionFormula)
Description copied from interface: IAlert

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.

Specified by:
setAlertConditionFormula in interface IAlert
Parameters:
newConditionFormula - The com.crystaldecisions.sdk.occa.report.data.IDataConditionFormula object.

setEnable

public void setEnable(boolean newEnable)
Description copied from interface: IAlert

Sets whether the alert is enabled and can be triggered.

Specified by:
setEnable in interface IAlert
Parameters:
newEnable - true if the alert is enabled and can be triggered, and false otherwise.

setMessage

public void setMessage(java.lang.String newMessage)
Description copied from interface: IAlert

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) MessageFormula overrides the values set using this method.

Specified by:
setMessage in interface IAlert
Parameters:
newMessage - the message to be set.

setAlertMessageFormula

public void setAlertMessageFormula(IDataConditionFormula newMessageFormula)
Description copied from interface: IAlert

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).

Specified by:
setAlertMessageFormula in interface IAlert
Parameters:
newMessageFormula - The com.crystaldecisions.sdk.occa.report.data.IDataConditionFormula object.

setName

public void setName(java.lang.String newName)
Description copied from interface: IAlert

Sets the name of the alert.

Specified by:
setName in interface IAlert
Parameters:
newName - The name of the alert as a String.

startElement

public void startElement(java.lang.String eleName,
                         java.util.Map objState,
                         org.xml.sax.Attributes attrs)

For internal use only.


getTriggeredMessages

public Strings getTriggeredMessages(int numOfInstances)
                             throws ReportSDKException
Description copied from interface: IAlert

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

Specified by:
getTriggeredMessages in interface IAlert
Returns:
An array of Strings as the triggered instances of the alerts.
Throws:
ReportSDKException

internalSetTriggeredMessages

public void internalSetTriggeredMessages(Strings messages)
Deprecated. 

For internal use only.


getControllableMixin

public ControllableMixin getControllableMixin()

doControllerModification

public void doControllerModification(java.lang.Object newObject)
                              throws ReportSDKException
Throws:
ReportSDKException

isDirectlyControllable

public boolean isDirectlyControllable()

enumerateMembers

public void enumerateMembers(IMemberVisitor visitor)