Hi
Im trying to select from 3 tables Orders,Receipts and Customers. I get the records that I want throght SQL but when I attempt to view the data in Crystal Report I get na empty report.
Here is the code:
Im trying to select from 3 tables Orders,Receipts and Customers. I get the records that I want throght SQL but when I attempt to view the data in Crystal Report I get na empty report.
Here is the code:
Code:
Dim con As New OleDb.OleDbConnection(My.Settings.KazaConstructionConnectionString)
Dim ds As New DataSet
Dim com As New OleDb.OleDbCommand("Select Receipts.ReceiptNumber,Customers.CustomerID,Customers.Name,Orders.OrderID,Orders.Normal,Orders.Resistant,Orders.Total,Orders.PaymentType,Orders.EmployeeName from Orders,Customers,Receipts where Customers.CustomerID=Orders.CustomerID and Customers.CustomerID=Receipts.CustomerID and Orders.OrderDate=#" & nowdate & "#", con)
Dim da As New OleDb.OleDbDataAdapter(com.CommandText, con)
Try
con.Open()
da.Fill(ds)
con.Close()
Catch ex As Exception
End Try
If ds.Tables(0).Rows.Count = 0 Then
MessageBox.Show("There are no Orders made today", "No Orders", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
End If
Dim rcpt As New DailyReport
Dim rpt As New Reports
rcpt.SetDataSource(ds.Tables(0))
rpt.CRV.ReportSource = rcpt
rpt.ShowDialog()