|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.crystaldecisions.sdk.occa.report.application.GroupController
public class GroupController
This object is used to add, remove, and modify groups in a report. The order in which a
Group object appears in an array of items is important because it represents how
the data is grouped in the report. For more information, see the
Groups collection.
Note:
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.ResultFields
array. For more information, see ResultFieldController object.
Tip: To access the GroupController, use the getGroupController
method in the DataDefController object.
| Method Summary | |
|---|---|
int |
add(int index,
IGroup group)
Adds a group to the report. |
int |
add(int index,
java.lang.String fieldName)
Adds a group to the report. |
int |
add(int index,
java.lang.String fieldName,
BooleanCondition booleanCondition)
For internal use only |
int |
add(int index,
java.lang.String fieldName,
DateCondition dateCondition)
Adds a group to the report. |
int |
add(int index,
java.lang.String fieldName,
SortDirection direction,
DateCondition dateCondition)
For internal use only |
boolean |
canGroupOn(IField field)
Deprecated. As of version 4.0. Replaced by (IField field, boolean forGridCondition). |
static boolean |
canGroupOn(IField field,
boolean forGridCondition)
Returns true if the field can be used to group data, and false
otherwise. |
IGroup |
findGroup(IField field)
Retrieves the group corresponding to the specified field. |
void |
modify(IGroup oldGroup,
IGroup newGroup)
Modifies a group. |
void |
modify(int index,
IGroup newGroup)
Modifies a group. |
void |
move(IGroup group,
int nTo)
Changes the order in which the group appears on the report. |
void |
move(int nFrom,
int nTo)
Changes the order in which the group appears on the report. |
void |
remove(IGroup group)
Removes a group from the report. |
void |
remove(int index)
Removes a group from the report. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public int add(int index,
IGroup group)
throws ReportSDKException
Adds a group to the report. This method returns the index of the item in the collection after
it has been added. The Groups collection can be accessed by using the
getGroups()
method in the DataDefinition object. The index is zero-based. Before adding a
group to the report, use the GroupController.canGroupOn(IField) method to see if a particular field
can be used to group data.
Note: Any fields that you want displayed in your report must be added to the
ResultFields array. For more information, see ResultFieldController
object.
index - The position in the array where you want to add the group. Specify -1 to add the
object to the end of the array.group - The group that you want to add.
ReportSDKExceptionpublic boolean canGroupOn(IField field)
(IField field, boolean forGridCondition).
Returns true if the field can be used to group data, and false
otherwise. Before adding a group to the report, use this method to see if a particular field
can be used to group data on.
field - The field that you want to group data on.
true if the field can be used to group data, and false
otherwise.
public static boolean canGroupOn(IField field,
boolean forGridCondition)
Returns true if the field can be used to group data, and false
otherwise. Before adding a group to the report, crosstab or detail chart, use this method to
see if a particular field can be used to group data on.
field - The field that you want to group data onforGridCondition - true if the field is used in crosstab or detail chart
true if the field can be used to group data, and false
otherwise.
public IGroup findGroup(IField field)
throws ReportSDKException
Retrieves the group corresponding to the specified field. If the field has not been grouped on, null
is returned.
field - The field that is being grouped on (the condition field).
ReportSDKException
public void modify(int index,
IGroup newGroup)
throws ReportSDKException
Modifies a group. The Groups collection can be accessed by using the
getGroups()
method in the DataDefinition object. The index is zero-based. This method
replaces an existing group with an entirely new group.
Use the findGroup method to retrieve a group given a particular
condition field (the field that is being grouped on).
index - The index of the group to be modified in the Groups collection.newGroup - The new Group object.
ReportSDKException
public void modify(IGroup oldGroup,
IGroup newGroup)
throws ReportSDKException
Modifies a group. The Groups collection can be accessed by using the
getGroups()
method in the DataDefinition object. The index is zero-based. This method
replaces an existing group with an entirely new group. This means that you cannot retrieve a
group, change its condition field, and then re-add the group; instead, you must create a new
Group object that will overwrite the old one.
Use the findGroup method to retrieve a group given a particular
condition field (the field that is being grouped on).
oldGroup - The Group object to be modified in the Groups
collection.newGroup - The new Group object.
ReportSDKException
public void move(int nFrom,
int nTo)
throws ReportSDKException
Changes the order in which the group appears on the report. The Groups
collection is accessed by using the
getGroups()
method in the DataDefinition object. The index is zero-based. The order in
which groups appear in the Groups collection is important because it
represents how the data is grouped in the report. The first group in the collection is the
outermost group in the report; similarly, the last group in the collection is the innermost
group in the report.
nFrom - The index of the group to be moved in the Groups collection.nTo - The new index position of the Group object.
ReportSDKException
public void move(IGroup group,
int nTo)
throws ReportSDKException
Changes the order in which the group appears on the report. The Groups
collection is accessed by using the
getGroups()
method in the DataDefinition object. The index is zero-based. The order in
which groups appear in the Groups collection is important because it
represents how the data is grouped in the report. The first group in the collection is the
outermost group in the report; similarly, the last group in the collection is the innermost
group in the report.
group - The Group object to be moved in the Groups
collection.nTo - The new index position of the Group object.
ReportSDKException
public void remove(int index)
throws ReportSDKException
Removes a group from the report. The Groups collection can be accessed by
using the
getGroups()
method in the DataDefinition object. The index is zero-based.
index - The index of the group to be removed from the Groups collection.
ReportSDKException
public void remove(IGroup group)
throws ReportSDKException
Removes a group from the report. The Groups collection can be accessed by
using the
getGroups()
method in the DataDefinition object. The index is zero-based.
group - The Group object to be removed from the Groups
collection.
ReportSDKException
public int add(int index,
java.lang.String fieldName,
DateCondition dateCondition)
throws ReportSDKException
Adds a group to the report. The dateCondition parameter defines how the data
is grouped if the field, described by fieldName's value type is a
FieldValueType
dateField, timeField, or dateTimeField. It is
ignored for any other value of FieldValueType.
NOTE: Any group that you want displayed in your report must be added to the ResultFields
array. For more information, see the ResultFieldController object.
index - the position in the array where you want to add the group object; specify -1 to
add the object to the end of the array.fieldName - field name in formula formatdateCondition - the DateCondition of the group.
ReportSDKException
public int add(int index,
java.lang.String fieldName,
BooleanCondition booleanCondition)
throws ReportSDKException
ReportSDKException
public int add(int index,
java.lang.String fieldName,
SortDirection direction,
DateCondition dateCondition)
throws ReportSDKException
ReportSDKException
public int add(int index,
java.lang.String fieldName)
throws ReportSDKException
Adds a group to the report.
index - the position in the array where you want to add the group object; specify -1 to
add the object to the end of the array.fieldName - field name in formula format
ReportSDKException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||