Quantcast
Channel: Crystal Reports
Viewing all articles
Browse latest Browse all 1507

Passing Parameter to crystal report is not working

$
0
0

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.




Viewing all articles
Browse latest Browse all 1507

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>