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, XMLSerializationContext ctxt, java.util.Map objState, boolean[] bLoaded)
           
 void endElement(java.lang.String eleName, java.util.Map objState)
           
 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.
 IFormula getFormula(TranslatableStringId id)
          For internal use only
 java.lang.String getImageKey()
           For internal use only.
 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.
 int getNumInstances()
          For internal use only.
 IClone getTranslatableObject()
          For internal use only
 java.lang.String getTranslatableString(TranslatableStringId id)
          For internal use only
 java.util.List getTranslatableStringIds()
          For internal use only
 java.lang.String getTranslatableStringLabelResourceID(TranslatableStringId id)
          For internal use only
 java.lang.String getTriggeredMessage()
          For internal use only.
 boolean hasContent(java.lang.Object obj)
           
 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 readElement(java.lang.String eleName, java.lang.String sVal, org.xml.sax.Attributes attrs, java.util.Map objState)
           
 void save(XMLWriter writer, java.lang.String sTag, XMLSerializationContext ctxt)
           
 void save(XMLWriter writer, XMLSerializationContext ctxt)
           
 void saveContents(XMLWriter writer, XMLSerializationContext ctxt)
           
 void setAlertConditionFormula(IDataConditionFormula newConditionFormula)
          For internal use only
 void setAlertMessageFormula(IDataConditionFormula newMessageFormula)
          For internal use only
 void setConditionFilter(IFilter conditionFilter)
          Sets the filter to determine if the alert should be 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 setMessageFormula(IFormulaField messageFormula)
          Sets the formula to create the message to display if the alert is triggered.
 void setName(java.lang.String newName)
           Sets the name of the alert.
 void setNumInstances(int nInstances)
          For internal use only.
 void setTranslatableString(TranslatableStringId id, java.lang.String newText)
          For internal use only
 void setTriggeredMessage(java.lang.String message)
          For internal use only.
 void startElement(java.lang.String eleName, java.util.Map objState, org.xml.sax.Attributes attrs)
           
 
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,
                                     XMLSerializationContext ctxt,
                                     java.util.Map objState,
                                     boolean[] bLoaded)

endElement

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

getConditionFilter

public IFilter getConditionFilter()
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 IFilter object.

setConditionFilter

public void setConditionFilter(IFilter conditionFilter)
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:
setConditionFilter in interface IAlert
Parameters:
conditionFilter - The IFilter object.

getAlertConditionFormula

public IDataConditionFormula getAlertConditionFormula()
Description copied from interface: IAlert
For internal use only

Specified by:
getAlertConditionFormula in interface IAlert

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()
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 IFormulaField object.

setMessageFormula

public void setMessageFormula(IFormulaField messageFormula)
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:
setMessageFormula in interface IAlert
Parameters:
messageFormula - The IFormulaField object.

getAlertMessageFormula

public IDataConditionFormula getAlertMessageFormula()
Description copied from interface: IAlert
For internal use only

Specified by:
getAlertMessageFormula in interface IAlert

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

getTriggeredMessage

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

Specified by:
getTriggeredMessage in interface IAlert

readElement

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

save

public void save(XMLWriter writer,
                 XMLSerializationContext ctxt)
          throws java.io.IOException
Throws:
java.io.IOException

save

public void save(XMLWriter writer,
                 java.lang.String sTag,
                 XMLSerializationContext ctxt)
          throws java.io.IOException
Throws:
java.io.IOException

saveContents

public void saveContents(XMLWriter writer,
                         XMLSerializationContext ctxt)
                  throws java.io.IOException
Throws:
java.io.IOException

setAlertConditionFormula

public void setAlertConditionFormula(IDataConditionFormula newConditionFormula)
Description copied from interface: IAlert
For internal use only

Specified by:
setAlertConditionFormula in interface IAlert

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). Using a message formula overrides the message string 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
For internal use only

Specified by:
setAlertMessageFormula in interface IAlert

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)

setTriggeredMessage

public void setTriggeredMessage(java.lang.String message)
For internal use only.


setNumInstances

public void setNumInstances(int nInstances)
For internal use only.


getNumInstances

public int getNumInstances()
For internal use only.


getTranslatableStringIds

public java.util.List getTranslatableStringIds()
For internal use only


getTranslatableString

public java.lang.String getTranslatableString(TranslatableStringId id)
For internal use only


setTranslatableString

public void setTranslatableString(TranslatableStringId id,
                                  java.lang.String newText)
For internal use only


getTranslatableStringLabelResourceID

public java.lang.String getTranslatableStringLabelResourceID(TranslatableStringId id)
For internal use only


getFormula

public IFormula getFormula(TranslatableStringId id)
For internal use only


getTranslatableObject

public IClone getTranslatableObject()
For internal use only


getImageKey

public java.lang.String getImageKey()

For internal use only.