|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.crystaldecisions.sdk.occa.report.application.SortController
RecordSortController and GroupSortController. To move or re-order
group sorts, use the GroupController to move the groups.
@Deprecated public class SortController
This object is used to modify the way in which data in the report is sorted. If a report contains groups, then a sort order can be applied to these groups as well as to the details within each group.
Note: When you add a group to the Groups collection, a group sort is automatically added to the Sorts collection. Group sorts should be in the same order as groups. To ensure that the order remains the same in both collections, add groups (and therefore group sorts) to the report before adding detail sorts.
The order of the Sort objects in the collection's array is important since it defines
the order in which the fields will be sorted. The field in the Sort object in
item(0) will be sorted first. For example, if you have two database fields displayed on a
report--Country and Customer Name--as item(0) and item(1) respectively, then the information in
the Country column will be sorted first, and the details in the Customer Name field will be
sorted next. If Customer Name is moved to the first position, then this field is what the rowset
is initially sorted on.
If a group contains a summary, it is possible for the group to be Top N sorted. In a Top N sort,
groups are sorted according to the group summary that was inserted, and the data is grouped
according to the group name for the first N groups. The groups that are not included in the Top N
are either discarded or grouped under a specified name. For more details, see the TopNSort
object.
ResultFieldController object.
SortController, use the getSortController
method in the DataDefController object.
| Method Summary | |
|---|---|
int |
add(int index,
ISort sort)
Deprecated. As of version 4.0. |
boolean |
canSortOn(IField field)
Deprecated. As of version 4.0. |
boolean |
canTopNSortOn(IField field)
Deprecated. As of version 4.0. |
ISort |
findSort(IField field)
Deprecated. As of version 4.0. |
void |
modify(int index,
ISort newSort)
Deprecated. As of version 4.0. |
void |
modify(ISort oldSort,
ISort newSort)
Deprecated. As of version 4.0. |
void |
modifySortDirection(int index,
SortDirection direction)
Deprecated. As of version 4.0. |
void |
modifySortDirection(ISort sort,
SortDirection direction)
Deprecated. As of version 4.0. |
void |
move(int nFrom,
int nTo)
Deprecated. As of version 4.0. |
void |
move(ISort sort,
int nTo)
Deprecated. As of version 4.0. |
void |
remove(int index)
Deprecated. As of version 4.0. |
void |
remove(ISort sort)
Deprecated. As of version 4.0. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
@Deprecated
public int add(int index,
ISort sort)
throws ReportSDKException
Adds a sort to the report. This method returns the index of the item in the collection after it
has been added. A sort object is stored in the Sorts collection, which can be accessed through
the getSorts() method in the
DataDefinition object. The index is zero-based. The new Sort
object is added to the end of the collection and will be sorted after all the other fields in the
Sort objects have been sorted.
Before adding a sort to the report, use the canSortOn method to see if
a particular field can be used to sort data.
index - The position in the array where you want to add the ISort object.
Specify -1 to add the object to the end of the array.sort - The sort that you want to add to the report.
int that specifies the index at which the ISort object
was added.
ReportSDKException@Deprecated public boolean canSortOn(IField field)
Returns true if the field can be used to sort data, and false otherwise.
Before adding a sort to the report, use this method to see if a particular field can be used to sort data.
Only recurring fields can be sorted.
field - The field that you want to sort data on.
true if the field can be used to sort data, and false otherwise.@Deprecated public boolean canTopNSortOn(IField field)
Returns true if the field can be used to do a Top N sort, and false
otherwise. Only summary fields that are based on a group can be Top N sorted.
Use this method to check if the field that you want to sort data on is a summary field based on a
group. For example, suppose that you have grouped your data by Country and summarized Last Year's
Sales for each group. This function will return true if you pass in the summary
field as the argument.
field - The field that you want to sort data on.
true if the field can be used to do a Top N sort, and false otherwise.
@Deprecated
public ISort findSort(IField field)
throws ReportSDKException
Retrieves a sort given a particular field. If the field has not been sorted on, null
is returned.
field - The field that has (or has not) been used to sort on.
ISort object corresponding to the given field.
ReportSDKException
@Deprecated
public void modify(int index,
ISort newSort)
throws ReportSDKException
Modifies a sort. The collection of Sort objects can be accessed by using the
getSorts method
in the DataDefinition object. The index is zero-based.
index - The index of the sort to be modified in the collection.newSort - The new Sort object.
ReportSDKException
@Deprecated
public void modify(ISort oldSort,
ISort newSort)
throws ReportSDKException
Modifies a sort. The collection of Sort objects can be accessed by using the
getSorts method
in the DataDefinition object. The index is zero-based.
oldSort - The Sort object to be modified in the collection.newSort - The new Sort object.
ReportSDKException
@Deprecated
public void move(int nFrom,
int nTo)
throws ReportSDKException
Moves a Sort object from one position in the array to another.
The collection of Sort objects can be accessed by using the getSorts
method in the DataDefinition object. The index is zero-based.
The order of the Sort objects in the collection's array is important since it
defines the order in which the fields will be sorted. The Sort object in item(0)
will be sorted first.
nFrom - The index of the Sort object to be moved in the collection.nTo - The new index position of the Sort object.
ReportSDKException
@Deprecated
public void move(ISort sort,
int nTo)
throws ReportSDKException
Moves a Sort object from one position in the array to another.
The collection of Sort objects can be accessed by using the getSorts
method in the DataDefinition object. The index is zero-based.
The order of the Sort objects in the collection's array is important since it
defines the order in which the fields will be sorted. The Sort object in item(0)
will be sorted first.
sort - The Sort object to be moved in the collection.nTo - The new index position of the Sort object.
ReportSDKException
@Deprecated
public void remove(int index)
throws ReportSDKException
Removes a sort from the collection. The collection of Sort objects can be
accessed by using the getSorts
method in the DataDefinition object. The index is zero-based.
index - The index of the Sort object to be removed from the collection.
ReportSDKException
@Deprecated
public void remove(ISort sort)
throws ReportSDKException
Removes a sort from the collection. The collection of Sort objects can be
accessed by using the getSorts
method in the DataDefinition object. The index is zero-based.
sort - The Sort object to be removed from the collection.
ReportSDKException
@Deprecated
public void modifySortDirection(int index,
SortDirection direction)
throws ReportSDKException
Modifies the direction of a sort found by sort index.
The sort direction can be changed from the existing sort direction to any one of
ascending order, descending order, only sorting the bottom N items, only sorting
the top N items, sorting the bottom N percentage, or the top N percentage as defined by
SortDirection
Example:
This sample shows how to modify how data in the report is sorted. The sort direction can be changed from the existing sort direction to any one of the following options as defined in the CrSortDirectionEnum enumeration: ascending order, descending order, sorting only the bottom N items, sorting only the top N items.
DataDefController dataDefController = clientDoc.getDataDefController();
SortController sortController = dataDefController.getSortController();
sortController.modifySortDirection( 0, SortDirection.ascendingOrder );
index - the index of the sort whose direction you will modify.
The sort index which is the Item property of the Sorts collection.direction - the new direction of the sort as defined by SortDirection.
ReportSDKException
@Deprecated
public void modifySortDirection(ISort sort,
SortDirection direction)
throws ReportSDKException
Modifies the direction of a sort by sort index.
The sort direction can be changed from the existing sort direction to any one of
ascending order, descending order, only sorting the bottom N items, only sorting
the top N items, sorting the bottom N percentage, or the top N percentage as defined by
SortDirection
sort - the ISort object whose direction you will modifydirection - the new direction of the sort as defined by SortDirection.
ReportSDKException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||