In this post, I will show you how to add two parameters “name” and “title” to our reports. If you are new in Reporting Services, you can check this tutorial. It's very simple to understood. Now, after you have created the report, in the report data pane, click on the “View” then “Report Data” to show the pane.
This below image shown the report data pane
In the Report Data Pane, right click on the “parameters” node and click on add parameter. A dialog shown below is presented. Enter the name of your parameter and choose the data type.
On the design you are done. Go to you where the report data will be supplied in your code. Make sure to import (“Imports Microsoft.Reporting.WinForms“).
For example we have a procedure which accepts parameters including a collection of parameters
1: Public Sub fillReport(ByVal dataset As String, ByVal reportname As String, ByVal loadData As DataTable, ByVal parameters As ReportParameterCollection)
2: Me.ReportViewer1.ProcessingMode = ProcessingMode.Local
3: Me.ReportViewer1.LocalReport.ReportPath = Application.StartupPath + "/" + reportname + ".rdlc"
4: Me.ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource(dataset, loadData))
5: Me.ReportViewer1.LocalReport.SetParameters(parameters)
6: Me.ReportViewer1.RefreshReport()
7: End Sub
Join the conversation! Your thoughts help the community grow.