I am developing a database application in Visual Studion 2008 (VB.Net) . I want to create a stock report which receives data from 2 different tables i.e Products and Stock. I have designed the report but it shows a blank report (only headings, but no data)
I have used the following code to populate report
v1 is an instance of crystal report viewer
I have used the following code to populate report
Code:
Dim r As New rptStock
Dim ds As New DataSet("DataSet1")
Dim da1 As New SqlCeDataAdapter("Select * from Products", db.getConnection)
Dim da2 As New SqlCeDataAdapter("Select * from Stock", db.getConnection)
Dim dt1 As New DataTable("Products")
Dim dt2 As New DataTable("Stock")
da1.Fill(dt1)
da2.Fill(dt2)
ds.Tables.Add(dt1)
ds.Tables.Add(dt2)
Dim dr As New DataRelation("pk1", dt1.Columns("Code"), dt2.Columns("ProductId"))
ds.Relations.Add(dr)
r.SetDataSource(ds)
v1.ReportSource = r
v1.Show()
Comment