Hello everyone. I have developed a web based inventory and accounts system using c# in VS2010, Sql server 2008 and Crystal Reports for VS2010. I am Passing parameters to a test crystal report as under the following which seems to work fine only for the first time but don't update the parameter value subsequent times.
private void SetDate1AndDate2Parameters(ReportDocument RptDoc) { ParameterFieldDefinition PFD = RptDoc.DataDefinition.ParameterFields["ParamDate1"]; ParameterValues PV = new ParameterValues(); ParameterDiscreteValue PDV=new ParameterDiscreteValue(); PDV.Value = Convert.ToDateTime(TextBox1.Text); PV.Add(PDV); PFD.ApplyCurrentValues(PV); }
When i change the value for the parameter that changed value is not reflected in the parameter on crystal reports. There is another way of passing parameters i have come to know after googling i.e. to use crystalreportviewer.ParameterFieldsInfo which in my case is not appropriate because I have FromDate and ToDate parameters of the same name in many of my reports for which i have written a generic method to pass their value to show them on the report.
I am desperately waiting for your guidance.