You must know the name and type of a parameter to
use the following method to set the value.
Note: If you do not know the name or type a
parameter, use the
DataDefinition class to
retrieve the
ParameterFields
collection saved in the report. For an example see
To modify a parameter field.
Use the
setCurrentValue method in the
ParameterFieldController class
to set parameters to the appropriate type and value.
Example:
void setDiscreteParameter(ReportClientDocument rcd) throws ReportSDKException
{
ParameterFieldController paramController = rcd.getDataDefController().getParameterFieldController();
paramController.setCurrentValue("", "StringParam", "A text string.");
paramController.setCurrentValue("", "NumericParam", Integer.valueOf("200"));
paramController.setCurrentValue("", "CurrencyParam", Float.valueOf("1000.00"));
paramController.setCurrentValue("", "BooleanParam", Boolean.valueOf("true"));
paramController.setCurrentValue("", "DateParam", new Date());
paramController.setCurrentValue("", "TimeParam", new Date());
paramController.setCurrentValue("", "DateTimeParam", new Date(Long.valueOf("1234567890000")));
}Note: To set the value of dynamic cascading
parameters you must set the value of the parameters in the order they will be
displayed.
This list includes the classes used by the sample
code:
com.crystaldecisions.sdk.occa.report.application.ParameterFieldController
com.crystaldecisions.sdk.occa.report.application.ReportClientDocument
com.crystaldecisions.sdk.occa.report.lib.ReportSDKException
java.util.Date