Dim strrpt As String = " select inv.* from inv where inv_id between'" & txtRpt_invid1.Text & "' and '" & txtRpt_invid2.Text & "'"
Dim cm As New OleDbCommand(strrpt, con)
Dim dt As New DataTable
con.ConnectionString = strconnect
With com
.Connection = con
.CommandText = strrpt
.CommandType = CommandType.Text
End With
da.SelectCommand = cm
da.Fill(ds, "datatable2")
dt = ds.Tables(0)
da = Nothing
con.Close()
con = Nothing
Dim rpt As New ReportDocument()
Dim directory As String = My.Application.Info.DirectoryPath
rpt.Load("C:\Users\user\Documents\Visual Studio 2008\Projects\Unilife\Unilife\rptReport.rpt")
rpt.SetDataSource(dt)
Me.rptview.ReportSource = rpt
Me.rptview.Refresh()