C#如何使用参数过滤报表查看器

时间:2018-11-01 04:12:06

标签: c# sql filter report rdlc

因此令人沮丧的是,无法设法过滤报表查看器,我尝试了许多在线教程,但都没有帮助。因此,这是我的代码,用于在表格AddPoTbl中显示项目以向查看者报告。

CmbViewPo();
ItemDataSet m = new ItemDataSet();
SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM AddPoTbl", con);
da.Fill(m, m.Tables[0].TableName);

ReportDataSource rds = new ReportDataSource("PoDataSet", m.Tables[0]);
this.reportViewPo.LocalReport.DataSources.Clear();
this.reportViewPo.LocalReport.DataSources.Add(rds);
this.reportViewPo.LocalReport.Refresh();
this.reportViewPo.RefreshReport();

我想用我的组合框的值或保存组合框值的参数对其进行过滤。 我尝试过滤tablix中的行 请帮我解决一下这个。

谢谢!

1 个答案:

答案 0 :(得分:0)

您可以为要过滤的列添加参数。

  • 右键单击报告中的表格
  • 属性
  • 过滤器
  • 添加表达式、运算符
  • 选择参数作为过滤器

仅此而已。请观看以下视频了解更多详情。

https://youtu.be/psLVbNx0GtU?t=358

enter image description here

相关问题