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

后端 未结 10 1359
孤独总比滥情好
孤独总比滥情好 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:53

    Imports Microsoft.Reporting.WebForms
    
    Partial Class Rpt_reports
    Inherits System.Web.UI.Page
    
      Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        If Not IsPostBack Then
            Dim ds As New Custamer
            'da.Fill(ds.Tables("custamer")
            Dim path As String = Server.MapPath("customerinfo.rdlc")
    
            ReportViewer1.LocalReport.DataSources.Clear()
            ReportViewer1.LocalReport.ReportPath = path
            ReportViewer1.LocalReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource("Rpt_reports", ds.Tables("Custamer")))
            ReportViewer1.LocalReport.Refresh()
        End If
      End Sub
    
      'Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    
      'End Sub
    
    End Class
    

提交回复
热议问题