com.crystaldecisions.sdk.occa.report.application
Class GroupController

java.lang.Object
  extended by com.crystaldecisions.sdk.occa.report.application.GroupController

public class GroupController
extends java.lang.Object

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:

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)
           Adds a group to the report.
 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)
           Adds a group to the report.
 int add(int index, java.lang.String fieldName, SortDirection direction, DateCondition dateCondition)
           Adds a group to the report.
static boolean canGroupOn(IField field)
           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

add

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 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.

Parameters:
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.
Returns:
int The index that the group was added at.
Throws:
ReportSDKException

canGroupOn

public static boolean canGroupOn(IField field)

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.

Parameters:
field - The field that you want to group data on.
Returns:
true if the field can be used to group data, and false otherwise.

findGroup

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.

Parameters:
field - The field that is being grouped on (the condition field).
Returns:
The group specified by the field.
Throws:
ReportSDKException

modify

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).

Parameters:
index - The index of the group to be modified in the Groups collection.
newGroup - The new Group object.
Throws:
ReportSDKException

modify

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).

Parameters:
oldGroup - The Group object to be modified in the Groups collection.
newGroup - The new Group object.
Throws:
ReportSDKException

move

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 outermost group in the report.

Parameters:
nFrom - The index of the group to be moved in the Groups collection.
nTo - The new index position of the Group object.
Throws:
ReportSDKException

move

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 outermost group in the report.

Parameters:
group - The Group object to be moved in the Groups collection.
nTo - The new index position of the Group object.
Throws:
ReportSDKException

remove

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.

Parameters:
index - The index of the group to be removed from the Groups collection.
Throws:
ReportSDKException

remove

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.

Parameters:
group - The Group object to be removed from the Groups collection.
Throws:
ReportSDKException

add

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.

Parameters:
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
dateCondition - the DateCondition of the group.
Returns:
the index of the group after it has been added. The index is zero based.
Throws:
ReportSDKException

add

public int add(int index,
               java.lang.String fieldName,
               BooleanCondition booleanCondition)
        throws ReportSDKException

Adds a group to the report. The booleanCondition parameter defines how the data is grouped if the field, described by fieldName's value type is a FieldValueType booleanField. 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.

Parameters:
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
booleanCondition - the BooleanCondition of the group.
Returns:
the index of the group after it has been added. The index is zero based.
Throws:
ReportSDKException

add

public int add(int index,
               java.lang.String fieldName,
               SortDirection direction,
               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.

Parameters:
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
direction - the sort direction of the group field
dateCondition - defines how data is grouped if the group is sorted by a date field
Returns:
The position of the item after it has been added.
Throws:
ReportSDKException

add

public int add(int index,
               java.lang.String fieldName)
        throws ReportSDKException

Adds a group to the report.

Parameters:
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
Returns:
The position of the item after it has been added.
Throws:
ReportSDKException

add

public int add(int index,
               java.lang.String fieldName,
               SortDirection direction)
        throws ReportSDKException

Adds a group to the report.

Parameters:
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
direction - the sort direction of the group field
Returns:
The position of the item after it has been added.
Throws:
ReportSDKException