|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SortInfo
Warning: This interface is no longer functional from the SAP BusinessObjects 4.0 release onwards.
TheSortInfo
interface gives the way to customise the sort
order for a DPExpression
, VariableExpression
or
Link
object's values.
A SortInfo
instance holds a
custom List Of Values
containing the sort order
Values
in the expression instance.
If a customised sort has not been defined by a user, the
CustomSortLov
is sorted in alphanumerical order.
Note: A custom sort cannot be applied to a
FormulaExpression
.
DPExpression.getSortInfo()
,
VariableExpression.getSortInfo()
,
Link.getSortInfo()
,
ReportDictionary
,
SortInfoType
,
CustomSortLov
,
CustomSortValues
,
FormulaExpression
Method Summary | |
---|---|
boolean |
canApplyCustomSort()
Returns true if a custom sort can be applied to the
expression instance. |
boolean |
canHaveUserValues()
Returns true if user defined values can be added to
the CustomSortLov . |
void |
deleteCustomSort()
Delete the CustomSortLov defined in the
SortInfo instance. |
CustomSortLov |
getCustomSortLov()
Returns a custom ordered LOV containing
the Values in the expression instance. |
int |
getMaxValues()
Returns the maximum number of values that can be contained in the CustomSortLov instance. |
SortInfoType |
getSortInfoType()
Returns the sort order currently applied to the expression. |
boolean |
isCustomSortDefined()
Returns true if a CustomSortLov has been defined. |
void |
setCustomSortLov(java.lang.String[] lov)
Replace the current CustomSortValues by an ordered
list of values. |
Method Detail |
---|
CustomSortLov getCustomSortLov()
custom ordered LOV
containing
the Values
in the expression instance.
If a customised sort has not been defined by a user, the
CustomSortLov
is sorted in alphanumerical order.
Note: The maximum number of values contained in
the returned CustomSortLov
is never greater than
.
SortInfo.getMaxValues()
CustomSortLov
instance.
CustomSortException
- when Custom sort isn't defined yet and
the retrievec alphanumerical ordered lov size is greater then SortInfo.getMaxValues()
REException
- if anything else is wrong.void setCustomSortLov(java.lang.String[] lov) throws REException
CustomSortValues
by an ordered
list of values.
The new sort order is applied to all SortElement
objects based on the expression (DPExpression
,
VariableExpression
, Link
) in the current
document. User defined values can be added to this LOV if
SortInfo.canHaveUserValues()
returns true
.
Note: The input LOV should hold all of values contained in the default list and be in ascending order.
Example:
// Variables used in this example are:
// doc - An open DocumentInstance.
// rExpr - A DPExpression taken from 'doc'.
SortInfo sort = rExpr.getSortInfo();
if (sort.canApplyCustomSort())
{
CustomSortLov lov = sort.getCustomSortLov();
CustomSortValues values = lov.getAllValues();
String[] oldList = new String[values.getCount()];
for (int i=0; i < values.getCount(); i++)
{
oldList[i] = values.getValue(i);
}
// Re-order the values in the list.
String[] newList = new String[values.getCount()];
for (int i=0; i < values.getCount(); i++)
{
newList[i] = oldList[values.getCount()-i-1];
}
sort.setCustomSortLov(newList);
// new storage token contains the new state of 'doc'.
String storageToken = doc.getStorageToken();
}
Depending on the type
of expression ( DATE
,
NUMERIC
, ...), the values
should be in the default format. Retrieve the default
format using ReportEngine.getFormatNumbers(FormatNumberType type)
.
lov
- A customized list of values in ascending order.
CustomSortException
- If
lov.length > SortInfo.getMaxValues()
.
java.lang.UnsupportedOperationException
- If
SortInfo.canApplyCustomSort()
returns false
.
java.lang.IllegalArgumentException
- if lov
is null
or lov.length == 0
.
REException
- Any other problems.ObjectType
,
ReportExpression.getType()
void deleteCustomSort()
CustomSortLov
defined in the
SortInfo
instance.
When this method has been called all instance of SortElement based on the expression will be sorted in alphanumeric order.
java.lang.IllegalStateException
- If the
CustomSortLov
is still in use.
REException
- if anything else is wrong.boolean isCustomSortDefined()
true
if a CustomSortLov
has been defined.
true
if a CustomSortLov
has
been defined.int getMaxValues()
CustomSortLov
instance.
CustomSortLov
instance.boolean canApplyCustomSort()
true
if a custom sort can be applied to the
expression instance.
Note:
If this SortInfo
is from a MEASURE qualified expression or
if it's from a DIMENSION qualified expression belongs to a Link
,
it returns false
.
true
if a custom sort can be applied to the
expression instance.
CustomSortException
- when Custom sort isn't defined yet and
the retrieve alphanumerical ordered lov size is greater then SortInfo.getMaxValues()
REException
- if anything else is wrong.boolean canHaveUserValues()
true
if user defined values can be added to
the CustomSortLov
.
true
if user defined values can be added to
the CustomSortLov
.CustomSortLov
,
CustomSortValues
SortInfoType getSortInfoType()
The sort can be either SortInfoType.ALPHANUMERIC
or SortInfoType.CUSTOM
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |