A data source instance has not been supplied for the data source“Product_Detail” in Microsoft reporting service

后端 未结 10 1342
孤独总比滥情好
孤独总比滥情好 2021-02-07 03:19

I`m trying to display record in a Report. Data is in the Dataset. but it is not binind to them. When forms load it shows it report layout. But when i click on the button it show

10条回答
  •  迷失自我
    2021-02-07 03:54

        Dim rptDataSource As ReportDataSource
        Try
            With Me.ReportViewer1.LocalReport
                ReportViewer1.LocalReport.ReportPath = Application.StartupPath & "\RTFLS\Report1.rdlc"
                '.DataSources.Clear()
            End With
            Dim ds As New POAS.CustomersTotalPayment 
            Dim da As New POAS.CustomersTotalPaymentTableAdapters.PAYMENTSTATUSTableAdapter
    
            da.Fill(ds.PAYMENTSTATUS)
    
            rptDataSource = New ReportDataSource("CustomersTotalPayment", ds.Tables("PAYMENTSTATUS"))
            Me.ReportViewer1.LocalReport.DataSources.Add(rptDataSource)
    
            Me.ReportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout)
        Catch ex As Exception
            MessageBox.Show(ex.Message, My.Application.Info.Title, MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    
    
        Me.ReportViewer1.RefreshReport()
    

提交回复
热议问题