Hi all,
I have a report in Vb.net and I used Crystal report viewer contorol.
The problem is I have 2 prameter in my report and I don't know how to pass the value to them.
- Dim rpt As New rptOpenCase()
-
Dim con As SqlConnection
-
Dim sql As String
-
Dim da As New SqlDataAdapter
-
Dim ds As New DataSet
-
con = New SqlConnection(strCon)
-
con.Open()
-
sql = " SELECT [Case ID], [Open Date], Name, Worker, Service, [Issue Type], Fee,OD"
-
Sql &= " FROM dbo.vOpenCase "
-
If txtStartdate.Text <> "" And txtEndDate.Text <> "" Then sql &= " WHERE (OD BETWEEN '" & txtStartdate.Text & "' AND '" & txtEndDate.Text & "')"
-
-
da = New SqlDataAdapter(Sql, con)
-
da.Fill(ds)
-
rpt.Refresh()
-
rpt.SetDataSource(ds.Tables(0))
-
CrystalReportViewer1.ReportSource = rpt
-
rpt.Refresh()
-
CrystalReportViewer1.Zoom(75)
-
Publicds = ds.Copy()
I tried so many things that I found on the net but none of them worked.I need exact code.
I just want to show txtStartDate and txtEndDate on top of my report.
Please help me.