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

All Known Subinterfaces:
IParameterFieldDiscreteValue, IParameterFieldRangeValue, IParameterFieldValue
All Known Implementing Classes:
ParameterFieldDiscreteValue, ParameterFieldRangeValue, ParameterFieldValue, Value

public interface IValue

This interface is used as a base class to represent different kinds of values (values in formulas, parameters, and so on). It is not to be used directly, and the actual value is defined in the implementing class.


Method Summary
 java.lang.String computeText()
          The computeText method returns a String representation of the field value that can be used in a report formula.
 java.lang.String displayText(java.util.Locale locale)
          Returns the field's value as a localized and formatted String.
 

Method Detail

computeText

public java.lang.String computeText()

The computeText method returns a String representation of the field value that can be used in a report formula.

The String is not formatted or localized. The syntax will always be Crystal syntax. If the field contains a date, computeText returns Date(x, x, x); if it contains a date and time, computeText returns DateTime(x, x, x, x, x, x). However, when the date is 1900, 0, 1 (the Java start date), ComputeText returns Time(x, x, x). If you want to set a field to a time value only (that is, with no date), you should set the date to 1900, 0, 1, so that computeText will retrieve the correct information.

Returns:
A String representation of the field value that can be used in a report formula.

displayText

public java.lang.String displayText(java.util.Locale locale)

Returns the field's value as a localized and formatted String. The Locale can be a java.util.Locale value.

The value is formatted according to the locale. The user is required to pass in a locale; the system default locale or user default locale is not used. If the field contains a date, displayText returns a locale-specific date string; if it contains a date and time, displayText returns a locale-specific date time String; if it contains a time String, displayText returns a locale-specific time String.

Parameters:
locale - The locale as specified by java.util.Locale .
Returns:
The field's value as a localized and formatted String.