Private Sub Crystal_Repaddtool_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim rpt As New ReportDocument
Dim directory As String = My.Application.Info.DirectoryPath
rpt.Load("C:\store\Rep_Addtool.rpt")
rpt.SetDataSource(dtVal)
rpt.DataDefinition.FormulaFields.Item("dtVal1").Text = "''" 'Clear ค่าก่อน
rpt.DataDefinition.FormulaFields.Item("dtVal1").Text = "'" & dt1 & "'"
rpt.DataDefinition.FormulaFields.Item("dtVal2").Text = "''" 'Clear ค่าก่อน
rpt.DataDefinition.FormulaFields.Item("dtVal2").Text = "'" & dt2 & "'"
CrystalReportViewer1.ReportSource = rpt
CrystalReportViewer1.Refresh()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub