问题描述
嗨专家,
我创建了.xsd文件,数据显示在预览中。我获取了.rpt文件中的所有字段并传递了两个参数。当我运行我的下面的代码Reportviewer时只显示参数值。我怎样才能获得数据?
请帮助我这个无奈!
ReportDocument reportCaseByAgency = new ReportDocument ();
reportCaseByAgency.Load(Server.MapPath(@〜/ Reports / RPT_CaseByAgency.rpt));
reportCaseByAgency.FileName = Server.MapPath(@ 〜/ Reports / RPT_CaseByAgency.rpt);
reportCaseByAgency.SetParameterValue(@ QTR,num2);
reportCaseByAgency.SetParameterValue(@ Year,year);
ReportViewer1.ReportSource = reportCaseByAgency;
//reportCaseByAgency.ReadRecords();
//ReportViewer1.RefreshReport();
//ReportViewer1.DataBind();
谢谢,
Shafik
Hi Experts,
I have created .xsd file and data is showing in the preview.I took all the fields in .rpt file and passing two parameters. When I run my below code Reportviewer showing only Parameter values. How can I get data?
Please help me to this helpless!
ReportDocument reportCaseByAgency = new ReportDocument();
reportCaseByAgency.Load(Server.MapPath(@"~/Reports/RPT_CaseByAgency.rpt"));
reportCaseByAgency.FileName = Server.MapPath(@"~/Reports/RPT_CaseByAgency.rpt");
reportCaseByAgency.SetParameterValue("@QTR", num2);
reportCaseByAgency.SetParameterValue("@Year", year);
ReportViewer1.ReportSource = reportCaseByAgency;
//reportCaseByAgency.ReadRecords();
//ReportViewer1.RefreshReport();
//ReportViewer1.DataBind();
Thanks,
Shafik
推荐答案
reportCaseByAgency.SetDataSource(myDataSet);
$ b设置ReportView1.ReportSource之前$ b
。
before setting the ReportView1.ReportSource.
这篇关于CrystalReportViewer中未显示数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!