C# Crystal Reports不断提示输入参数
我对.NET4.0的CrystalReport2010有一个严重的问题(我使用的是固定的13.0.1版本,但13.0.4已经发布)。无论我用哪种方式尝试,我总是会得到一个提示对话框,第一次输入我的一个参数值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
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应用此参数。将选择公式放在单击按钮程序上