本文介绍了vs2010的报告和我的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好.我制作了一个WinForms应用程序,并在窗体上使用ReportViewer并为其设计了一个报告(.rdlc),现在在报告中选择表和storeprocedure,并为我的存储过程和forn load事件定义参数我写的表格
Hi every body. I make a WinForms app and i use ReportViewer on my form and i design a report(.rdlc) for it,now in my report i select my table and storeprocedure and i define the parameter for my store procedure and in forn load event of my form i write
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the ''testoDataSet.Table2'' table. You can move, or remove it, as needed.
this.Table2TableAdapter.Fill(this.testoDataSet.Table2);
ReportParameter pa = new ReportParameter("Name", "abc");
ReportParameter pa1 = new ReportParameter("Family", "xyz");
reportViewer1.LocalReport.SetParameters(new ReportParameter[] { pa, pa1 });
reportViewer1.LocalReport.Refresh();
this.reportViewer1.RefreshReport();
}
但是当我运行我的应用程序时,所有记录都显示在报告查看器中,但我选择的查询是:
but when i run my app all records showed on my report viewer but my select query is:
select * from User where Name=''abc'' and Family=''xyz'';
what is wrong??
推荐答案
this.Table2TableAdapter.FillByNameAndFamily(this.DataSet1.Table2, "abc", "xyz");
this.reportViewer1.RefreshReport();
这篇关于vs2010的报告和我的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!