Question Parameter in RDLC report

Shane1961

New member
Joined
Jun 1, 2024
Messages
3
Programming Experience
Beginner
In a RDLC report I have a parameter named "allocated_jobs"

It has no Available Values.

It has 1 Default Value: RTrim(Allocated = "True")

ie; Only rows with field name Allocated and it's contents equal "True" are to be in the report.
VB.NET:
Dim rds = New ReportDataSource("Jobapps_ds", Me.JobsAppBindingSource)

Me.JobsDataReportViewer.LocalReport.DataSources.Add(rds)
Me.JobsDataReportViewer.LocalReport.ReportEmbeddedResource = "Data_Reporting.JobsList.rdlc" 'Report path in my.settings

Dim allocated_param As Microsoft.Reporting.WinForms.ReportParameter

allocated_param = New Microsoft.Reporting.WinForms.ReportParameter("allocated_jobs")
Me.JobsDataReportViewer.LocalReport.SetParameters(allocated_param)
Me.JobsDataReportViewer.RefreshReport()

The report runs fine, no errors, but without the desired return of the parameter.

Thankyou.
 
Last edited by a moderator:
When creating the report parameter, you need to specify the field and the value to test for. See this article for a good example of that How to pass parameter in rdlc report in vb net - Visual Basic NET SOS

Thank you jdelano. This example does not show me how to add a parameter correctly in report builder for the desired output as described. I thought a parameter with a Default Value; Allocated = "True" would be correct .Then in form load or a button click event, use SetParameters(myParameter) to show results. As I said, the report runs without error, but also without desired output. Variations of syntax, ie; =(Fields!myfield, "dataset1") in the report builder have only given error msgs.
 
Back
Top