ParameterFieldDefinitions paraFieldDefinitions; ParameterFieldDefinition paraFieldDefinition; ParameterValues paraVals = new ParameterValues();
ParameterDiscreteValue paraDiscreatValue = new ParameterDiscreteValue(); paraDiscreatValue.Value = tbxCustomerName.Text;
paraFieldDefinitions = rptDoc.DataDefinition.ParameterFields; paraFieldDefinition = paraFieldDefinitions["customerName"]; //could "customerName" field parameter hold more than one value? paraVals = paraFieldDefinition.CurrentValues; //why we clear this? this will clear off the values that was assigned from the //previouse line. paraVals.Clear(); //add the parameter values to the collection paraVals.Add(paraDiscreatValue); //what happense here? paraFieldDefinition.ApplyCurrentValues(paraVals);
|
Hi, i have included all my question under comments, they are few issues related to crystal reports, use of paramters!
TY
Roei BarPosted Oct 19, 2009, 2:46 AM
Nilanka DharmadasaPosted Oct 19, 2009, 3:01 AM
ParameterValues paraVals = new ParameterValues();
ParameterDiscreteValue paraDiscreatValue = new ParameterDiscreteValue();
paraDiscreatValue.Value = tbxCustomerName.Text;
paraVals.Add(paraDiscreatValue);
ParameterFieldDefinition paraFieldDefinition = paraFieldDefinitions["customerName"];
parameterFieldDefinition.ApplyCurrentValues(paraVals);
This code will help you. You don't have to clear off the values. Use this.