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

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

public class FilterController
extends java.lang.Object

This object is used to modify filters in a report. Filters are used in record selection and group selection formulas.

If you add a filter that has an invalid syntax, the method that you are using will not fail; instead, an error is returned when you try to view the report.

Tip: To access the FilterController object, use the DataDefController.getGroupFilterController() method or the DataDefController.getRecordFilterController() property in the DataDefController object.


Method Summary
 boolean canFilterOn(IField field)
           Returns true if the field can be filtered, and false otherwise.
 java.lang.String getFormulaText()
          Returns the filter formula text for a particular record or group filter
 void modify(IFilter filter)
          Modifies the filter for a particular record or group selection.
 void setFormulaText(java.lang.String text)
           Modifies the filter formula text for a particular record or group filter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

canFilterOn

public boolean canFilterOn(IField field)

Returns true if the field can be filtered, and false otherwise.

Use this method to determine if a field can be added to a record filter or a group filter. For example, a recurring field, formula field, or parameter field can be added to a record filter, whereas a summary field can be added only to a group filter. Only summary fields and formula fields can be used to filter groups.

Parameters:
field - The field whose data is being filtered.
Returns:
Returns true if the field can be filtered, and false otherwise.

modify

public void modify(IFilter filter)
            throws ReportSDKException
Modifies the filter for a particular record or group selection.

Parameters:
filter - The newly modified filter
Throws:
ReportSDKException

getFormulaText

public java.lang.String getFormulaText()
Returns the filter formula text for a particular record or group filter

Returns:
String the formula text as described above
See Also:
setFormulaText(java.lang.String)

setFormulaText

public void setFormulaText(java.lang.String text)
                    throws ReportSDKException

Modifies the filter formula text for a particular record or group filter.

This method will store the formula string in the FreeEditingText property of the Filter object. The FreeEditingText property of the Filter object is a custom selection formula that cannot be parsed.

Example:

This sample shows how to modify filters in a report. Filters are used in record selection and group selection to select specified data.

 DataDefControlleer dataDefController = clientDoc.getDataDefController();
 FilterController filterController = dataDefController.getRecordFilterController();
 filterController.setFormulaText( "{Table.Field} = 'value'" );
 

Parameters:
text - text of the formula to be set. This formula is used as a filter for either a record or a group.
Throws:
ReportSDKException
See Also:
getFormulaText()