Skip to content

Instantly share code, notes, and snippets.

@NPS-ARCN-CAKN
Created November 13, 2017 17:38
Show Gist options
  • Save NPS-ARCN-CAKN/e9fa6ca12e78ff5181e447130b0deb2c to your computer and use it in GitHub Desktop.
Save NPS-ARCN-CAKN/e9fa6ca12e78ff5181e447130b0deb2c to your computer and use it in GitHub Desktop.
VB .NET: Filter a report (windows forms)
'Put a report viewer on a form and build the report using the wizard
'Create a report parameter based on the filter criteria you would like to use. "IDReportParameter",22, for example to filter on ID=22
'In the report open the Tablix's properties and select Filters and set up the filter using the wizard
'In the master DataGridView's SelectionChanged (or other event) event add code similar to
Dim MyReportParameter As New ReportParameter("IDReportParameter", 22)
Me.WorkLogReportViewer.LocalReport.SetParameters(MyReportParameter)
Me.WorkLogReportViewer.RefreshReport()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment