问题描述
我正在使用c#.net开发一个Windows窗体应用程序,在我的应用程序中,我想使用form1中的日期时间选择器输入开始日期和结束日期,并且需要在所选日期之间打开包含数据的水晶报表form2作为一个新窗口我已经设计了水晶报告,报告工作正常。然后设计form2与水晶报表查看器来查看报告。但我不知道如何将form1中的日期(参数)传递给包含水晶报表查看器的form2。请有人可以帮我这样做。
尝试使用以下代码,但没有任何反复
我尝试了什么:
myDataSet ds = new myDataSet();
frm_ReportViewer viewForm = new frm_ReportViewer();
viewForm.Owner = this;
rpt_myreport report = new rpt_myreport();
report.Load(Reports \\rpt_myreport。 rpt);
report.SetDataSource(ds);
viewForm.crv_common.ReportSource = report;
viewForm.ShowDialog(this);
Hi, I'm developing a windows forms application using c#.net, in my application i want to enter start date and end date using a date time picker in form1 and need to open a crystal report with data between selected dates on form2 as a new window I've already designed crystal report and the report works fine. then designed form2 with crystal report viewer to view the report. but i don't know how to pass dates (parameters) from form1, to form2 which contain crystal report viewer. please someone can help me to do this.
Tried with following code, but nothing happened
What I have tried:
myDataSet ds = new myDataSet();
frm_ReportViewer viewForm = new frm_ReportViewer();
viewForm.Owner = this;
rpt_myreport report = new rpt_myreport();
report.Load("Reports\\rpt_myreport.rpt");
report.SetDataSource(ds);
viewForm.crv_common.ReportSource = report;
viewForm.ShowDialog(this);
推荐答案
这篇关于如何在新窗口中传递参数以加载水晶报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!