Hello,
I want to pass the values that the client chose in the windows forms application as parameters in crystal report.
I have a period range that he/she chooses (I have two datetimepickers on the form) and a text box. These values I want to pass as parameters to the crystal report.
Can anybody help me please?
Thanks
Loading

AartiRank #2,383 · 594 reputationPosted Nov 14, 2011, 1:52 AM EST
use below code.. may be it will help you
// Create parameter objects ParameterFields myParams = new ParameterFields(); ParameterField myParam = new ParameterField(); ParameterDiscreteValue myDiscreteValue = new ParameterDiscreteValue(); // Set the ParameterFieldName to the name of the parameter // created in the Field Explorer myParam.ParameterFieldName = "Country"; // Add first country myDiscreteValue.Value = "USA"; myParam.CurrentValues.Add(myDiscreteValue); // Reuse myDiscreteValue, and assign second country myDiscreteValue = new ParameterDiscreteValue(); myDiscreteValue.Value = "Netherlands"; myParam.CurrentValues.Add(myDiscreteValue); // Add param object to params collection myParams.Add(myParam); // Assign the params collection to the report viewer myCrystalReportViewer.ParameterFieldInfo = myParams; // Assign the Report to the report viewer. // This method uses a strongly typed report, // but other methods are possible as well. myCrystalReportViewer.ReportSource = MyReportObject;NelRank #2,060 · 702 reputationPosted Nov 14, 2011, 3:28 AM EST
ParameterRangeValue myRangevalue= new ParameterRangeValue;
how to define myRangevalue.Value to be <=something and >=something ?