Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/334.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Crystal Reports不断提示输入参数_C#_Vb.net_C# 4.0_Crystal Reports_Crystal Reports 2010 - Fatal编程技术网

C# Crystal Reports不断提示输入参数

C# Crystal Reports不断提示输入参数,c#,vb.net,c#-4.0,crystal-reports,crystal-reports-2010,C#,Vb.net,C# 4.0,Crystal Reports,Crystal Reports 2010,我对.NET4.0的CrystalReport2010有一个严重的问题(我使用的是固定的13.0.1版本,但13.0.4已经发布)。无论我用哪种方式尝试,我总是会得到一个提示对话框,第一次输入我的一个参数值 CrystalReportViewer1.ReportSource = CustomerReport1; CustomerReport1.Database.Tables[0].SetDatasource ( this.dataset); CustomerReport1

我对.NET4.0的CrystalReport2010有一个严重的问题(我使用的是固定的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.
我也试过:

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

CrystalReportViewer1.ReportSource = CustomerReport1;
这是:

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 .
有人能帮忙吗?我对此感到沮丧。它在以前的版本中工作,但现在我得到了这个提示框


谢谢。

终于找到了解决方案。如果在
参数值
之后设置
数据源
,则不会提示

因此,如果我们将它们按以下顺序排列,其中任何一个都会起作用:

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

CrystalReportViewer1.ReportSource = CustomerReport1;

谢谢大家。

创建参数,但不要使用选择公式->记录为其分配公式。通过创建文本框、标签和按钮,从vb或c#.net IDE应用此参数。将选择公式放在单击按钮程序上