syntax101
Apr 29th, 2008, 01:57 AM
i want to display all datas with the selected date im using calendar month
but it gives me an error
Conversion from string "{daily.daily_datemilled} = 4/17/" to type 'Date' is not valid.
and if i change
" Dim mySelectFormula As Date" to "Dim mySelectFormula As String" the erros is Date is required here
Private Sub cal_daily_DateSelected(ByVal sender As Object, ByVal e As System.Windows.Forms.DateRangeEventArgs) Handles cal_daily.DateSelected
Dim s As Date = e.Start
s = CType(s.ToShortDateString, Date)
MsgBox(s)
Dim mySelectFormula As Date = "{daily.daily_datemilled} = " & s
Report.CrystalReportViewer1.SelectionFormula = mySelectFormula
Report.CrystalReportViewer1.ReportSource = New CrystalReport5
Report.CrystalReportViewer1.Zoom(75)
Report.CrystalReportViewer1.Refresh()
Report.CrystalReportViewer1.RefreshReport()
End Sub
but it gives me an error
Conversion from string "{daily.daily_datemilled} = 4/17/" to type 'Date' is not valid.
and if i change
" Dim mySelectFormula As Date" to "Dim mySelectFormula As String" the erros is Date is required here
Private Sub cal_daily_DateSelected(ByVal sender As Object, ByVal e As System.Windows.Forms.DateRangeEventArgs) Handles cal_daily.DateSelected
Dim s As Date = e.Start
s = CType(s.ToShortDateString, Date)
MsgBox(s)
Dim mySelectFormula As Date = "{daily.daily_datemilled} = " & s
Report.CrystalReportViewer1.SelectionFormula = mySelectFormula
Report.CrystalReportViewer1.ReportSource = New CrystalReport5
Report.CrystalReportViewer1.Zoom(75)
Report.CrystalReportViewer1.Refresh()
Report.CrystalReportViewer1.RefreshReport()
End Sub