Crystal Reports continues to request a parameter

I have a terrible problem with Crystal Report 2010 for .net 4.0 (I am using the corrected version 13.0.1, but version 13.0.4 is released). No matter which way I try, I always get a dialog box to enter the first parameter value.

CrystalReportViewer1.ReportSource = CustomerReport1; CustomerReport1.Database.Tables[0].SetDatasource ( this.dataset); CustomerReport1.SetParameterValue("PathLocation", Location.Text); CustomerReport1.Parameter_PathLocation.CurrentValues.Add(Location.Text) // to be safe using CS 2010 for .net 4 CrystalReportViewer1.ReuseReportParametersOnRefresh = true; // to prevent from showing again and again. 

I also tried this:

 CustomerReport1.Database.Tables[0].SetDatasource ( this.dataset); CustomerReport1.SetParameterValue("PathLocation", Location.Text); CrystalReportViewer1.ReportSource = CustomerReport1; 

And this:

 CustomerReport1.Database.Tables[0].SetDatasource ( this.dataset); CustomerReport1.Parameter_PathLocation.CurrentValues.Add(Location.Text) CrystalReportViewer1.ReportSource = CustomerReport1; // the parameter in the report has Optional Parameter = false, Static , Multiple Value = false . 

Can anybody help? I'm upset about this. It worked in previous versions, but now I get this request.

Thanks.

+4
source share
2 answers

Finally found a solution. It does not request if we set the DataSource after ParameterValue .

So, any of them will work if we put them in the following order:

 // First, call SetParameterValue. Then, call SetDatasource. CustomerReport1.SetParameterValue("PathLocation", Location.Text); CustomerReport1.Database.Tables[0].SetDatasource(this.dataset); CrystalReportViewer1.ReportSource = CustomerReport1; 

Thanks to everyone.

+5
source

create a parameter, but do not assign a formula to it using the selection formula → record. Apply this parameter from vb or C # .net IDE by creating a text box, label and button. Place the selection formula in the button click procedure.

0
source

All Articles