我正在使用 rdlc 根据参数动态显示报告。第一次加载时一切正常。但是在我更改参数并再次加载后,即使数据表值已更改。rdlc 显示之前的结果。什么是我想念这里
private void btnsearch_Click(object sender, EventArgs e)
{
reportLoad();
}
private void reportLoad()
{
var fromdate=txtfromdate.Text;
var todate=txttodate.Text;
var accontHead=ComboaccHead.SelectedValue;
var drawbankid=combodraw.SelectedValue;
var noabankid=combonoa.SelectedValue;
var type=ComboType.SelectedIndex;
spParamCollection.Clear();
spParamCollection.Add(new SPParams { Name = "@fromdate", Value =Convert.ToDateTime(fromdate).ToString("yyyy-MM-dd") });
spParamCollection.Add(new SPParams { Name = "@toDate", Value = Convert.ToDateTime(todate).ToString("yyyy-MM-dd") });
spParamCollection.Add(new SPParams { Name = "@AccountHead", Value = Convert.ToInt32(accontHead) });
spParamCollection.Add(new SPParams { Name = "@drawbankid", Value = Convert.ToInt32(drawbankid) });
spParamCollection.Add(new SPParams { Name = "@noabankid", Value = Convert.ToDecimal(noabankid) });
spParamCollection.Add(new SPParams { Name = "@type", Value = Convert.ToDecimal(type) });
DataTable dt = db.getDataUsingSP("CashBookReport", spParamCollection);
reportViewer1.Clear();
ReportDataSource rds = new ReportDataSource();
// reportViewer1.LocalReport.Refresh();
reportViewer1.Visible = true;
rds.Value = dt;
rds.Name = "KWADataSet";
reportViewer1.LocalReport.DataSources.Add(rds);
this.reportViewer1.RefreshReport();
}