Hello everyone,
I am currently developing a project in VB.Net and Ms Access and now, I got stuck while creating a crystal report where I need to display columns from three access tables which I am able to fetch using a query in Access. But the problem is that I am not able to create a crystal report and display the result of that query on the crystal report.
I have already created one crystal report which displays that records of an access table on the crystal report with the following code
Private Sub frmReportProcedures_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ds As New DataSet4
Dim ad As New DataSet4TableAdapters.proceduresTableAdapter
ad.Fill(ds.procedures)
Dim rpt As New rptAllProcedures
rpt.SetDataSource(ds)
CrystalReportViewer1.ReportSource = rpt
End Sub
This crystal report is working just fine.
Now, I just wanted to know how to create crystal report from the following SQL query
SELECT patients.patient_name, patients.residence, patients.contact, patients.procedure_date, patientprocedures.procedures, patientprocedures.procedure_cost, payments.amountPaid, payments.paymentDate
FROM (patients INNER JOIN patientprocedures ON patients.patient_id=patientprocedures.patient_id) INNER JOIN payments ON patients.patient_id=payments.patient_id;
Hope, I will get some help from you friends.
Thank you
What I have tried:
I have already coded the whole project except this report. I have already created a report which if display all the records of procedures table with the following code
Private Sub frmReportProcedures_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ds As New DataSet4
Dim ad As New DataSet4TableAdapters.proceduresTableAdapter
ad.Fill(ds.procedures)
Dim rpt As New rptAllProcedures
rpt.SetDataSource(ds)
CrystalReportViewer1.ReportSource = rpt
End Sub