|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface QuerySorts
Warning: This interface is no longer functional from the SAP BusinessObjects 4.0 release onwards.
QuerySorts
is a collection of QuerySort
objects.Example:Applying query sorts:
String sQuery = "SELECT SI_CUID, SI_NAME FROM"
+ " CI_APPOBJECTS WHERE SI_KIND ='"+ CeKind.UNIVERSE +"'";
IInfoObjects universes = (IInfoObjects) iStore.query(sQuery);
IInfoObject ceInfoobject = (IInfoObject)universes.get(31);
String universeId =((IUniverse)ceInfoobject).buildUniverseIdString();
DocumentInstance doc = repEng.newDocument(universeId);
ReportContainer report = doc.createReport("Report1");
DataProviders dps = doc.getDataProviders();
// Retrieve the 1st data provider
DataProvider dp = dps.getItem(0);
// Retrieve the universe objects
DataSource ds = dp.getDataSource();
DataSourceObject country = ds.getClasses().getChildByName("Country");
DataSourceObject revenue = ds.getClasses().getChildByName ("Revenue");
Query q = dp.getQuery();
// Add result objects to the query
q.addResultObject(country);
q.addResultObject(revenue);
QuerySorts sorts = q.getQuerySorts();
QuerySort sort = sorts.addQuerySort(revenue,SortType.DESCENDING);
// Run the query and fetch the data
dp.runQuery();
//To obtain the sorted result, you must call getResultAsXML{} on DataProvider.
CharacterView view = dp.getResultAsXML();
out.print(view.getContent());
Method Summary | |
---|---|
QuerySort |
addQuerySort(DataSourceObject obj,
SortType type)
Adds a sort on the specified data source object. |
int |
getCount()
Gets the number of sorts. |
QuerySort |
getQuerySort(int index)
Gets the specified sort. |
QuerySort |
getQuerySortByID(java.lang.String dsObjId)
Gets the QuerySort identified by it's data source object identifer. |
void |
moveQuerySort(int fromIndex,
int toIndex)
Swap two QuerySort objects at positions fromIndex
and toIndex in the collection. |
void |
removeAll()
Removes all sorts. |
void |
removeQuerySort(int index)
Removes the specified sort. |
Method Detail |
---|
int getCount()
QuerySort getQuerySort(int index)
index
- index of the sort to retrieve.
QuerySort getQuerySortByID(java.lang.String dsObjId)
QuerySort
identified by it's data source object identifer.
dsObjId
- data source object identifer
QuerySort
void removeQuerySort(int index)
index
- the index of the sort to deletevoid removeAll()
QuerySort addQuerySort(DataSourceObject obj, SortType type)
obj
- the data source objecttype
- the sort type to applied
QuerySort
void moveQuerySort(int fromIndex, int toIndex)
QuerySort
objects at positions fromIndex
and toIndex
in the collection.
fromIndex
- position of one QuerySort
to be swappedtoIndex
- position of the other QuerySort
to be swapped
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |