Visual Basic: Set a report's binding source

Platform:Visual Basic
Task:Set a report's binding source
You've set up a report with a datasource, but when you call the report there is no data. This is because the report forgets it's bindingsource, a known bug. Just reset the binding source when the form loads and on the bindingsource's CurrentChanged event.
   Private Sub TblVitalSignsBindingSource_CurrentChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TblVitalSignsBindingSource.CurrentChanged
    End Sub

    Private Sub SetReportBindingSource()
        Dim vsbs As New BindingSource(Me.TblVitalSignsBindingSource, "")
        Me.ReportViewer1.LocalReport.DataSources(0).Value = vsbs
    End Sub
Back to Index