To set the value of a discrete parameter

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