Crystal Reports 不断提示输入参数 [英] Crystal Reports keeps prompting for Parameter

查看:13
本文介绍了Crystal Reports 不断提示输入参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am having a terrible problem with crystal report 2010 for .net 4.0 (I am using the fixed 13.0.1 version but 13.0.4 is released). No matter which way I try, I am always getting a prompting dialogue box to input my one parameter value the first time.

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 .

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

Can anyone please help? I am getting frustrated with this. It worked in previous versions, but now I am getting this prompt box.

谢谢.

推荐答案

终于找到解决方案了.如果我们在ParameterValue之后设置DataSource,它不会提示.

Finally found the solution. It doesn't prompt if we set the DataSource after the ParameterValue.

因此,如果我们按以下顺序排列它们中的任何一个都可以工作:

So anyone of those will work if we put them in this order:

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

CrystalReportViewer1.ReportSource = CustomerReport1;

谢谢大家.

这篇关于Crystal Reports 不断提示输入参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆