Reputation: 6996
I am using ASP.NET/C#
.Currently I am displaying simple Report
following this tutorial.
In this tutorial they just selected the fields to display and it displayed the Reports
.
What about Reports
based on some conditions?
How can I show reports based on conditions?
Example:
Show the details of Employees whose name begins with 'A'. I hope I am able to explain my question.
Can anyone help me to do this?
Any suggestions are welcome.
Upvotes: 0
Views: 3305
Reputation: 17724
Reports take parameters. You can set these to filter out the data.
This set of tutorials should get you started: Adding Parameters to reports
Upvotes: 0
Reputation: 1192
Do you mean something like this?
ReportDataSource rds0 = new ReportDataSource("DataSetNameDefinedInReport", data);
this.reportViewer1.LocalReport.ReportPath = @"Reportname.rdlc";
this.reportViewer1.LocalReport.DataSources.Add(rds0);
//show report!
this.reportViewer1.RefreshReport();
The "data" in my case is a generic List of custom objects
Upvotes: 2