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

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

public class SummaryFieldController
extends java.lang.Object

This object is used to add, remove, and modify summary fields in a report.

Any fields that you want displayed in your report must be added to the collection of ResultField objects. However, unlike other fields, summary fields that are added to and removed from the SummaryFields collection are added to and removed from the ResultFields collection automatically, and vice versa. For more information, see the ResultFieldController object.

The SummaryFields collection and the ResultFields collection will have different index numbers. For example, suppose that item(2) in an array of ResultFields is a SummaryField. If this field is the first SummaryField in the ResultFields collection, then it will be item(0) in its own SummaryFields collection.

Tip: To access the SummaryFieldController, use the getSummaryFieldController method in the DataDefController.


Method Summary
 int add(int indexToAdd, ISummaryField summaryField)
           Adds a summary field to the report.
 boolean allowPercentageSummary(ISummaryField summaryField)
          For internal use only.
 boolean allowSummaryAcrossHierarchy(ISummaryField summaryField)
          For internal use only.
 boolean canEditSummaryField(ISummaryField summaryField)
           Returns true if the specified SummaryField is editable, and false otherwise.
 boolean canSummarizeOn(IField field)
           Returns true if the field has data that can be summarized, and false otherwise.
 void modifySummaryField(int index, ISummaryField newSummaryField)
           Modifies a summary field.
 void modifySummaryField(ISummaryField oldSummaryField, ISummaryField newSummaryField)
           Modifies a summary field.
 void remove(int index)
           Removes a summary field from the report.
 void remove(ISummaryField summaryField)
           Removes a summary field 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 indexToAdd,
               ISummaryField summaryField)
        throws ReportSDKException

Adds a summary field to the report. The index is zero-based.

This method returns the index of the item in the collection after it has been added. The collection of SummaryField objects can be accessed using the getSummaryFieldController method in the DataDefinition object. Before adding a summary field to the report, use the canSummarizeOn method to see if a particular field can be used to summarize data.

Note: Summary fields that are added to the SummaryFields collection are added to the ResultFields collection automatically, and vice versa. For more information, see the ResultFieldController object.

Parameters:
indexToAdd - The position in the array where you want to add the SummaryField object. Specify -1 to add the object to the end of the array.
summaryField - The summary field that you want to add to the report.
Returns:
An int that specifies the index at which the SummaryField was added.
Throws:
ReportSDKException

canEditSummaryField

public boolean canEditSummaryField(ISummaryField summaryField)

Returns true if the specified SummaryField is editable, and false otherwise.

Parameters:
summaryField - The summary field you wish to edit.
Returns:
true if the specified SummaryField is editable, and false otherwise.

canSummarizeOn

public boolean canSummarizeOn(IField field)
                       throws ReportSDKException

Returns true if the field has data that can be summarized, and false otherwise. Before adding a summary field to the report, use this method to see if a particular field can be used to summarize data.

Parameters:
field - The field whose data is being summarized.
Returns:
true if the field has data that can be summarized, and false otherwise.
Throws:
ReportSDKException

allowPercentageSummary

public boolean allowPercentageSummary(ISummaryField summaryField)
For internal use only.


allowSummaryAcrossHierarchy

public boolean allowSummaryAcrossHierarchy(ISummaryField summaryField)
For internal use only.


modifySummaryField

public void modifySummaryField(int index,
                               ISummaryField newSummaryField)
                        throws ReportSDKException

Modifies a summary field. The collection of SummaryField objects can be accessed using the getSummaryFieldController method in the DataDefinition object. The index is zero-based.

Parameters:
index - The index of the summary field to be modified in the collection.
newSummaryField - The new SummaryField object.
Throws:
ReportSDKException

modifySummaryField

public void modifySummaryField(ISummaryField oldSummaryField,
                               ISummaryField newSummaryField)
                        throws ReportSDKException

Modifies a summary field. The collection of SummaryField objects can be accessed using the getSummaryFieldController method in the DataDefinition object. The index is zero-based.

Parameters:
oldSummaryField - The SummaryField object to be modified in the collection.
newSummaryField - The new SummaryField object.
Throws:
ReportSDKException

remove

public void remove(int index)
            throws ReportSDKException

Removes a summary field from the report. The collection of SummaryField objects can be accessed using the getSummaryFieldController method in the DataDefinition object. The index is zero-based. Summary fields that are removed from the SummaryFields collection are removed from the ResultFields collection automatically, and vice versa. For more information, see the ResultFieldController object.

Parameters:
index - The index of the summary field to be removed from the collection.
Throws:
ReportSDKException

remove

public void remove(ISummaryField summaryField)
            throws ReportSDKException

Removes a summary field from the report. The collection of SummaryField objects can be accessed using the getSummaryFieldController method in the DataDefinition object. The index is zero-based. Summary fields that are removed from the SummaryFields collection are removed from the ResultFields collection automatically, and vice versa. For more information, see the ResultFieldController object.

Parameters:
summaryField - The SummaryField object to be removed from the collection.
Throws:
ReportSDKException