[英]RDLC winforms report will not display data
亲爱的,我有一个使用报告向导创建的报告。 我将患者ID从Form1传递到承载报告查看器的Form2。 该报告显示标题,并且我正在将参数传递到查询中。 但是,它根本不显示任何数据。 这是背后的代码。 当我设置断点时,PatientID当然不是null。
public BPReport(string PatientIDVal)
{
InitializeComponent();
string PatientID = PatientIDVal.ToString();
DateTime StartDate = Convert.ToDateTime(DateTime.Today.ToShortDateString()).AddDays(-30);
DateTime EndDate = Convert.ToDateTime(DateTime.Today.ToShortDateString());
txtPatientID.Text = PatientID.ToString();
dtpStartDate.Value = Convert.ToDateTime(StartDate.ToShortDateString());
dtpEndDate.Value = Convert.ToDateTime(EndDate.ToShortDateString());
ReportParameter[] param = new ReportParameter[3];
param[0] = new ReportParameter("StartDate", StartDate.ToString());
param[1] = new ReportParameter("EndDate", EndDate.ToString());
param[2] = new ReportParameter("PatientID", PatientID.ToString());
this.reportViewer1.LocalReport.SetParameters(param);
this.reportViewer1.RefreshReport();
}
好了,通过完全重新创建报告来解决此问题。 我取消了所有操作,再次进行了操作,现在可以使用了。 我怀疑这正是驻地专家可能会告诉我的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.