Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
sql = "select * from DocumentOT"
MyCommand = New MySqlCommand(sql, Con)
drConnection = MyCommand.ExecuteReader
dtConnection = New DataTable
dtConnection.Load(drConnection)
Dim myreport As New CrystalReport1
myreport.SetParameterValue("numberOT", dtConnection.Rows(a).Item(0).ToString)
CrystalReportViewer1.ReportSource = myreport
End Sub
Tag : .NET, Crystal Report, VB.NET, VS 2010 (.NET 4.x)
Dim rpt As New ReportDocument()
Dim directory As String = My.Application.Info.DirectoryPath
'rpt.Load(directory & "\myCrystalReport1.rpt")
rpt.Load("C:\DemoCrystalReport2\DemoCrystalReport2\myCrystalReport1.rpt") rpt.SetDataSource(dt)
Me.CrystalReportViewer1.ReportSource = rpt
Me.CrystalReportViewer1.Refresh()