G
Guest
Hi,
I want to push data from a winform into a crystal report document but .
I found everithing in the FAQ 'crystal report' and other posts in forums but it doesn't work.
Here is my code.(it doesn't work).
***************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim crpt As New CrystalReport2
Dim strSQL As String = "SELECT * from products WHERE SupplierId = 1"
Dim ds As New DataSet
Dim conn As SqlConnection = New SqlConnection("server=turing;database=northwind;integrated security=true;")
Dim da As SqlDataAdapter = New SqlDataAdapter(strSQL, conn)
conn.Open()
da.Fill(ds, "products")
conn.Close()
crpt.SetDataSource(ds)
CrystalReportViewer1.ReportSource = crpt
End Sub
***************
If someone could help me.
Thank you.
I want to push data from a winform into a crystal report document but .
I found everithing in the FAQ 'crystal report' and other posts in forums but it doesn't work.
Here is my code.(it doesn't work).
***************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim crpt As New CrystalReport2
Dim strSQL As String = "SELECT * from products WHERE SupplierId = 1"
Dim ds As New DataSet
Dim conn As SqlConnection = New SqlConnection("server=turing;database=northwind;integrated security=true;")
Dim da As SqlDataAdapter = New SqlDataAdapter(strSQL, conn)
conn.Open()
da.Fill(ds, "products")
conn.Close()
crpt.SetDataSource(ds)
CrystalReportViewer1.ReportSource = crpt
End Sub
***************
If someone could help me.
Thank you.