如何在代码中设置参数以水晶报表 [英] how to set parameter to crystal report in code
本文介绍了如何在代码中设置参数以水晶报表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Windows vb应用程序中有一个水晶报表,其中包含两个子报表和3个数据集.
我有4个参数
I have a crystal report in my windows vb application with two sub report and 3 datasets.
I have 4 parameters
How do I set parameter to report in code?
推荐答案
嘿..
1:转到字段资源管理器>>右键单击参数"字段>>新
2:例如给出正确的名称和数据类型.名称:S_DATE日期类型:DateTime
3:声明DateTime变量,例如. DateTime A_DATE,然后像这样传递它
hey..
1 : Go to field Explorer >> right click on Parameter field >> new
2 : Give Proper name and datatype for eg. name:S_DATE datetype:DateTime
3 : declare DateTime variable eg. DateTime A_DATE and now pass it like this
4 : ReportDocument crystalReport = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
5 : crystalReport.Load(Server.MapPath("filename.rpt";));
6 : crystalReport.SetDatabaseLogon("UserName";"Password";"ServerName";"DataBase name");
7 : crystalReport1.SetParameterValue("S_DATE", A_DATE);
希望对您有帮助
hope this help u
这篇关于如何在代码中设置参数以水晶报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文