private void frmPatientPhysicianReport_Load(object sender, EventArgs e) { //Declare a report object for use at runtime PatientPhysician aCustomerInvoicesReport; //Intantiate the report aCustomerInvoicesReport = new PatientPhysician(); try { //Instantiate the dataset and table adapters roomInvoicesDataSet = new MVCH_group3DataSet(); admitanceTableAdapter = new MVCH_group3DataSetTableAdapters.tblAdmittanceTableAdapter(); patientTableAdapter = new MVCH_group3DataSetTableAdapters.tblPatientsTableAdapter(); phyTableAdapter = new MVCH_group3DataSetTableAdapters.tblPhysicianTableAdapter(); //Fill the dataset using via the two table adapters //Fill with customers admitanceTableAdapter.Fill(roomInvoicesDataSet.tblAdmittance); //Fill with invoices patientTableAdapter.Fill(roomInvoicesDataSet.tblPatients); phyTableAdapter.Fill(roomInvoicesDataSet.tblPhysician); //Assign the filled dataset as the datasource for the report aCustomerInvoicesReport.SetDataSource(roomInvoicesDataSet); //Set up the report viewer object on the form to //show the runtime report object crystalReportViewer1.ReportSource = aCustomerInvoicesReport; } catch (Exception dataException) { //Catch any exception thrown during data object instantiation //or report generation and display based on the dataset MessageBox.Show("Data Error Encountered: " + dataException.Message); } }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { PatientPhysician rpt = new PatientPhysician(); rpt.Site = this.Site; return(rpt); }