/// <summary> /// Loads the data from MVCH_db onto the report layout from rptRooms. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmRoomUtilizationReport_Load(object sender, EventArgs e) { rptRooms aRoomReport; aRoomReport = new rptRooms(); // Initialize and fill data from the db. try { MVCHDataset = new MVCH_db_DataSet(); patientAdmissionTableAdapter = new MVCH_db_DataSetTableAdapters.Locations_Admitted_TableAdapter(); roomTableAdapter = new MVCH_db_DataSetTableAdapters.RoomsTableAdapter(); // An unknown error is causing an exception to be thrown, although the report loads correctly, so I'm catching the exception with no action. try { patientAdmissionTableAdapter.Fill(MVCHDataset.Locations_Admitted_); } catch (Exception) { } roomTableAdapter.Fill(MVCHDataset.Rooms); aRoomReport.SetDataSource(MVCHDataset); RoomUtilizationViewer.ReportSource = aRoomReport; } catch (Exception dataException) { MessageBox.Show("Data Error Encountered: " + dataException.Message); } this.RoomUtilizationViewer.RefreshReport(); }
/// <summary> /// Loads the data from MVCH_db onto the report layout from rptRooms. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmPhysicianPatientReport_Load(object sender, EventArgs e) { rptPhysicianPatient aPatientPhysicianReport; aPatientPhysicianReport = new rptPhysicianPatient(); // Initialize and fill data from the db. try { MVCHDataset = new MVCH_db_DataSet(); referredAdapter = new MVCH_db_DataSetTableAdapters.Patients_ReferredTableAdapter(); physicianAdapter = new MVCH_db_DataSetTableAdapters.PhysiciansTableAdapter(); patientAdapter = new MVCH_db_DataSetTableAdapters.PatientsTableAdapter(); locationsAdapter = new MVCH_db_DataSetTableAdapters.Locations_Admitted_TableAdapter(); // An unknown error is causing an exception to be thrown, although the report loads correctly, so I'm catching the exception with no action. try { locationsAdapter.Fill(MVCHDataset.Locations_Admitted_); } catch (Exception) { } patientAdapter.Fill(MVCHDataset.Patients); physicianAdapter.Fill(MVCHDataset.Physicians); referredAdapter.Fill(MVCHDataset.Patients_Referred); aPatientPhysicianReport.SetDataSource(MVCHDataset); PhysicianPatientViewer.ReportSource = aPatientPhysicianReport; } catch (Exception dataException) { MessageBox.Show("Data Error Encountered: " + dataException.Message); } this.PhysicianPatientViewer.RefreshReport(); }