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

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

public class ParameterFieldController
extends java.lang.Object

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

Note that any fields you want displayed in your report must be added to the ResultFields array. For more information, see the ResultFieldController object. If you want to view the parameter in the rowset, only discrete values (those that represent single values) are shown; ranged values will not be shown.

Tip: To access the ParameterFieldController object, use the getParameterFieldController method in the DataDefController object.

Note: Use the setTableLocation method to set parameter values for a table that is active in a report. See the setTableLocation method for an example of how to set parameter values in a command or stored procedures table.


Method Summary
 int add(IParameterField parameterField)
           Adds a parameter field to the report.
 Fields getPromptParameterFields(PropertyBag promptProperties)
          For internal use only.
 boolean isValidString(java.lang.String mask, java.lang.String stringValue)
           
 boolean isValidType(FieldValueType fieldValueType)
           Returns true if the type of parameter field value being used is valid, and false otherwise.
 void modify(int nIndex, IParameterField newParameterField)
           Modifies a parameter field.
 void modify(IParameterField oldParameterField, IParameterField newParameterField)
           Modifies a parameter field.
 void remove(int nIndex)
           Removes a parameter field from the report.
 void remove(IParameterField parameterField)
           Removes a parameter field from the report.
 void setCurrentValue(java.lang.String sReportName, java.lang.String sFieldName, double newValue)
           Sets a single value for the parameter field.
 void setCurrentValue(java.lang.String sReportName, java.lang.String sFieldName, java.lang.Object newValue)
           Sets a single value for the parameter field.
 void setCurrentValues(java.lang.String sReportName, java.lang.String sFieldName, java.lang.Object[] newValue)
           Sets the current values for the parameter field.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

add

public int add(IParameterField parameterField)
        throws ReportSDKException

Adds a parameter field to the report. This method returns the index of the item in the collection after it has been added. The collection of ParameterField objects can be accessed by using the getParameterFieldController method in the DataDefController object. The index is zero-based. Before adding a parameter field to the report, use the isValidType method to see if the parameter field value is valid.

Note: Any fields that you want displayed in your report must be added to the ResultFields array. For more information, see the ResultFieldController object.

Parameters:
parameterField - The parameter field that you want to add.
Returns:
An int that specifies the index of the added parameter field.
Throws:
ReportSDKException

getPromptParameterFields

public Fields getPromptParameterFields(PropertyBag promptProperties)
                                throws ReportSDKException

For internal use only.

Throws:
ReportSDKException

isValidType

public boolean isValidType(FieldValueType fieldValueType)

Returns true if the type of parameter field value being used is valid, and false otherwise. This method is used to check whether the specified field value type can be used as a parameter field value type. Before adding a parameter field to the report, use this method to see if the parameter field value is a valid type.

Parameters:
fieldValueType - The parameter field value type.
Returns:
true if the type of parameter field value being used is valid, and false otherwise.

modify

public void modify(int nIndex,
                   IParameterField newParameterField)
            throws ReportSDKException

Modifies a parameter field. The collection of ParameterField objects can be accessed by using the getParameterFieldController method in the DataDefController object. The index is zero-based.

Parameters:
nIndex - The index of the parameter field to be modified in the collection.
newParameterField - The new ParameterField object.
Throws:
ReportSDKException

modify

public void modify(IParameterField oldParameterField,
                   IParameterField newParameterField)
            throws ReportSDKException

Modifies a parameter field. The collection of ParameterField objects can be accessed by using the getParameterFieldController method in the DataDefController object. The index is zero-based.

Parameters:
oldParameterField - The ParameterField object to be modified in the collection.
newParameterField - The new ParameterField object.
Throws:
ReportSDKException

remove

public void remove(int nIndex)
            throws ReportSDKException

Removes a parameter field from the report. The collection of ParameterField objects can be accessed by using the getParameterFieldController method in the DataDefController object. The index is zero-based.

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

remove

public void remove(IParameterField parameterField)
            throws ReportSDKException

Removes a parameter field from the report. The collection of ParameterField objects can be accessed by using the getParameterFieldController method in the DataDefController object. The index is zero-based.

Parameters:
parameterField - The ParameterField object to be removed from the collection.
Throws:
ReportSDKException

setCurrentValues

public void setCurrentValues(java.lang.String sReportName,
                             java.lang.String sFieldName,
                             java.lang.Object[] newValue)
                      throws ReportSDKException

Sets the current values for the parameter field.

Parameters:
sReportName - The report in which the specified parameter field is contained.
sFieldName - The parameter field name.
newValue - The values that are to be stored in the parameter field.
Throws:
ReportSDKException

setCurrentValue

public void setCurrentValue(java.lang.String sReportName,
                            java.lang.String sFieldName,
                            double newValue)
                     throws ReportSDKException

Sets a single value for the parameter field.

NOTE: The sReportName parameter refers to the name of the subreport. To set the parameters in the main report, use an empty string as the sReportName parameter.

Parameters:
sReportName - the report that contains the specified parameter field
sFieldName - the parameter field name
newValue - the value that you want to store in the parameter field
Throws:
ReportSDKException

setCurrentValue

public void setCurrentValue(java.lang.String sReportName,
                            java.lang.String sFieldName,
                            java.lang.Object newValue)
                     throws ReportSDKException

Sets a single value for the parameter field.

NOTE: The sReportName parameter refers to the name of the subreport. To set the parameters in the main report, use an empty string as the sReportName parameter.

Parameters:
sReportName - the report that contains the specified parameter field
sFieldName - the parameter field name
newValue - the object that you want to store in the parameter field
Throws:
ReportSDKException

isValidString

public boolean isValidString(java.lang.String mask,
                             java.lang.String stringValue)