I am trying to call selected records to my report but anytime I select with a predefined variable as my selection criteria a receive the entire table to the report but what I need are records who match my selection criteria.
Please take a look at my code.
Public Sub Today_Punches()
Dim Pass_Geter As New Pass_Geter
Dim tag As String
Dim Ds As New DataSet()
Dim tester As New streetDA
Dim Employee As String = "Emile Devere"
Dim Datum As String = "string"
Dim dateValue As Date
Dim Date_Day As String
Datum = "Mon, May 02, 16"
If Not IsPostBack Then
Dim dt As DataTable
Dim SQL As String = "SELECT Employee,Datum ,Punch_Type,Bracket FROM Today_punches where Today_punches.Datum = Datum"
Dim strConnString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
Using conn As New SqlConnection(strConnString)
Using comm As New SqlCommand(SQL, conn)
conn.Open()
Using da As New SqlDataAdapter(comm)
dt = New DataTable("tbl")
da.Fill(dt)
End Using
End Using
End Using
Dim _rdStudents As ReportDocument = New ReportDocument()
Dim reportPath As String = Server.MapPath("Company_Punches.rpt")
_rdStudents.Load(reportPath)
_rdStudents.SetDataSource(dt)
CrystalReportViewer1.ReportSource = _rdStudents
End If
End Sub