Hi every1
i am new in crystal report and i am working on a project where i have to create a crystal report for the Tender per sales person but i am facing a problem where i can't display data from the second table in the report, i can only display data from one tables.
here is the code i am using:
Dim con As New SqlClient.SqlConnection(My.Settings.NewEvapcoDBConnectionString.ToString
Dim cmd As New SqlClient.SqlCommand("Select Tender.ETNumber, Tender.EnquiryDate, Tender.ProjectName, Tender.UnitType, Tender.ReqDate, Tender.NumberUnits, Sales.SalesPerson From Likelihood INNER JOIN Tender ON Likelihood.LikelihoodID= Tender.LikelihoodID INNER JOIN Sales ON Tender.SalesID= Sales.SalesID WHERE Likelihood.LikelihoodLevel LIKE '%A'")
Dim da As New SqlClient.SqlDataAdapter(cmd)
Dim ds As New TenderDataSet
Dim strReportName As String
Dim rptdoc As New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim strReportpath As String = ("D:\New EvapcoDB\New EvapcoDB\TenderReport.rpt")
Try
cmd.Connection = con
con.Open()
ds.Clear()
da.Fill(ds,
"TenderReport")
strReportName =
"TenderReport"
If Not IO.File.Exists(strReportpath) Then
MsgBox(
"An Error occured, impossible to find the report", vbCritical, "Error")
con.Close()
Exit Sub
End If
rptdoc.Load(strReportpath)
rptdoc.SetDataSource(ds.Tables(1))
rptdoc.Refresh()
TenderCrystalReportViewer.ReportSource = rptdoc
TenderCrystalReportViewer.Refresh()
Catch ex As Exception
System.Windows.Forms.
MessageBox.Show(ex.Message)
End Try
i am able to display all the items in my command but not the sales person which comes from the sales teble can any1 help me please???