Imports CrystalDecisions.CrystalReports.Engine
Public Class rp1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim tm As New Globalization.CultureInfo("en-US")
Dim EndDate As Date = DateTimePicker2.Value.Date.AddDays(1)
Dim rpt As New ReportDocument()
Dim directory As String = My.Application.Info.DirectoryPath
'rpt.Load(directory & "\myCrystalReport1.rpt")
rpt.Load("C:\Documents and Settings\Administrator\My Documents\Visual Studio 2010\Projects\nyp report\rp test\myCrystalReport1.rpt")
'rpt.SetParameterValue("idname", Me.idname.Text)
rpt.RecordSelectionFormula = "{Table1.To_day} in (#" & DateTimePicker1.Value.ToString(tm)
rpt.RecordSelectionFormula &= "# to #" & DateTimePicker2.Value.ToString(tm) & "#)"
Me.CrystalReportViewer1.ReportSource = rpt
Me.CrystalReportViewer1.Refresh()
End Sub