Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27355

[RESOLVED] ReportViewer Missing Datasource

$
0
0
Hello,

I created my dataset which contains a table from my SQL Database named "BillHeaders"

Here's what my report viewer looks like, it will contain two reports. One that holds a job number and description, the other that holds a job number, description and contract number.
Attachment 96665

Here are my buttons that will execute either report
Attachment 96663

Here are my reports in my "Reports" folder. Both constructed and ready to go.
Attachment 96661


Unfortuantely when I use this code (respectively for each button):
Code:

Private Sub btnJobNoDesc_Click(sender As System.Object, e As System.EventArgs) Handles btnJobNoDesc.Click
        'Reset the viewer
        frmReportViewer.ReportViewer1.Reset()

        'Dim the required datasources. Need a seperate ReportDatasource for each table in the report
        Dim ReportDataSource1 As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource

        'Give datasource name and set the specific datatables
        ReportDataSource1.Name = "dsBillHeaders_BillHeaders"
        ReportDataSource1.Value = frmReportViewer.dsBillHeaders.BillHeaders

        'Clear the datasources in the report and add the new ones
        frmReportViewer.ReportViewer1.LocalReport.DataSources.Clear()
        frmReportViewer.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource1)

        frmReportViewer.ReportViewer1.LocalReport.ReportEmbeddedResource = "ReportViewer_Tutorial.rptJobNoDesc.rdlc"
        frmReportViewer.ReportViewer1.RefreshReport()

        frmReportViewer.Show()
    End Sub


I get this result:
Attachment 96659

What am I doing wrong with my datasource?
Thank you!
Attached Images
       

Viewing all articles
Browse latest Browse all 27355

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>