Private Sub btnDisplayAll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplayAll.Click
If ComboBox1.SelectedIndex = 0 Then
CrystalReportViewer1.RefreshReport()
Dim orders As New rtpOrdersMonth
ChangDate2()
CrystalReportViewer1.SelectionFormula = "{orders.ord_date}>= #" & DtpDate2.Value.Date.ToString("yyyy-MM-") + date1 & "# and {orders.ord_date}<= #" & DtpDate2.Value.Date.ToString("yyyy-MM-") + date2 & "# "
CrystalReportViewer1.ReportSource = orders
End If
If ComboBox1.SelectedIndex = 1 Then
CrystalReportViewer1.RefreshReport()
Dim orders As New rtpOrderBetweenMonth
ChangDate2()
orders.SetParameterValue("Date1", Me.DtpDate1.Value.Date.ToString)
orders.SetParameterValue("Date2", Me.DtpDate2.Value.Date.ToString)
CrystalReportViewer1.SelectionFormula = "{orders.ord_date}>= #" & DtpDate1.Value.Date.ToString("yyyy-MM-") + date1 & "# and {orders.ord_date}<= #" & DtpDate2.Value.Date.ToString("yyyy-MM-") + date2 & "# "
CrystalReportViewer1.ReportSource = orders
End If
End Sub