Rcdl Report using dataset not displaying report.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gobindap
    New Member
    • Feb 2013
    • 25

    #1

    Rcdl Report using dataset not displaying report.

    Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    	Dim ds as DataSet
    	Dim rep As LocalReport = ReportViewer1.LocalReport
    	rep.ReportPath = "F:\My Work\VB\Report\Report3.rdlc"
    	ds = obj.GetRecords("SELECT * from kar", "Kar")
    	Dim RDS As New ReportDataSource()
    	RDS.Name = ds.Tables("Kars")
    	RDS.Value = ds.Tables("Kar")
    	rep.DataSources.Add(RDS)
    End Sub
    
    Public Function GetRecords(ByVal sql As String, ByVal tblName As String) As DataSet
            ds = New DataSet()
            da = New SqlDataAdapter(sql, cn)
            da.Fill(ds, tblName)
            Return ds
    End Function
    Last edited by Rabbit; May 10 '16, 05:07 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
Working...