Crystal Reports会一直提示参数

use*_*653 4 c# vb.net crystal-reports crystal-reports-2010 c#-4.0

我在.net 4.0的水晶报告2010中遇到了一个可怕的问题(我使用的是固定的13.0.1版本,但是发布了13.0.4).无论我尝试哪种方式,我总是会得到一个提示对话框,以便第一次输入我的一个参数值.

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.
Run Code Online (Sandbox Code Playgroud)

我也试过这个:

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

CrystalReportViewer1.ReportSource = CustomerReport1;
Run Code Online (Sandbox Code Playgroud)

还有这个:

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 .
Run Code Online (Sandbox Code Playgroud)

有人可以帮忙吗?我对此感到沮丧.它在以前的版本中有效,但现在我收到了这个提示框.

谢谢.

use*_*653 5

终于找到了解决方案.它不会提示我们是否设置了DataSource之后ParameterValue.

因此,如果我们按照这个顺序放置它们,那么任何人都会工作:

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

CrystalReportViewer1.ReportSource = CustomerReport1;
Run Code Online (Sandbox Code Playgroud)

谢谢你们.