imports Microsoft.Reporting.WinForms
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim ds As New WindowsApplication1.DataSet1
Dim rds As Microsoft.Reporting.WinForms.ReportDataSource
Dim tblAdp As SqlClient.SqlDataAdapter
Dim con As SqlClient.SqlConnection
Dim cmd As SqlClient.SqlCommand
Dim str = "Server=localhost;Database=NH0910;UID=;Password=;Trusted_Connection=True"
con = New SqlClient.SqlConnection(str)
Dim sql = "SELECT * FROM VENDOR"
cmd = New SqlClient.SqlCommand(sql, con)
cmd.CommandType = CommandType.Text
tblAdp = New SqlClient.SqlDataAdapter(cmd)
tblAdp.Fill(ds.tbl)
Me.ReportViewer1.RefreshReport()
Me.ReportViewer1.Reset()
Me.ReportViewer1.LocalReport.Dispose()
rds = New Microsoft.Reporting.WinForms.ReportDataSource("Table1", ds.Tables(0))
Me.ReportViewer1.LocalReport.DataSources.Clear()
Me.ReportViewer1.LocalReport.DataSources.Add(rds)
Me.ReportViewer1.LocalReport.ReportPath = "C:\Documents and Settings\m3\Local Settings\Application Data\Temporary Projects\WindowsApplication1\Report1.rdlc"
Me.ReportViewer1.SetDisplayMode(DisplayMode.PrintLayout)
'ReportViewer1.Show()
End Sub