コード例 #1
0
        private void MVCHForm_Load(object sender, EventArgs e)
        {
            //Declare a report object for the use at runtime
            roomUtilizationReport aRoomUtilizationReport;

            //Intantiate the report
            aRoomUtilizationReport = new roomUtilizationReport();

            try
            {
                //Instatiate the dataset and table adapters
                roomUtilizationDataSet = new MVCHDataDataSet();
                admissionsTableAdapter = new MVCHDataDataSetTableAdapters.admissionsTableAdapter();
                bedTableAdapter        = new MVCHDataDataSetTableAdapters.bedTableAdapter();
                roomsTableAdapter      = new MVCHDataDataSetTableAdapters.roomTableAdapter();
                patientTableAdapter    = new MVCHDataDataSetTableAdapters.patientTableAdapter();

                //Fille the dataset using via theese 4 table adapters
                //Fill with admission
                admissionsTableAdapter.Fill(roomUtilizationDataSet.admissions);
                //Fill with bed
                bedTableAdapter.Fill(roomUtilizationDataSet.bed);
                //Fill with rooms
                roomsTableAdapter.Fill(roomUtilizationDataSet.room);
                //Fill with patient
                patientTableAdapter.Fill(roomUtilizationDataSet.patient);

                //Set up the report viewer object on the form to show the runtime report object
                aRoomUtilizationReport.SetDataSource(roomUtilizationDataSet);
                rptCrystalViewer.ReportSource = aRoomUtilizationReport;
            }
            catch (Exception dataException)
            {
                //Catch any exception thrown during data object instantiation or report generation
                MessageBox.Show("Data Error Encountered: " + dataException.Message);
            }
        }
コード例 #2
0
        private void PhysicianPatientForm_Load(object sender, EventArgs e)
        {
            //Declare a report object for the use at runtime
            physicianPatientReport aPhysicianPatientReport;

            //Intantiate the report
            aPhysicianPatientReport = new physicianPatientReport();

            try
            {
                //Instatiate the dataset and table adapters
                physicianPatientDataSet = new MVCHDataDataSet();
                admissionsTableAdapter  = new MVCHDataDataSetTableAdapters.admissionsTableAdapter();
                bedTableAdapter         = new MVCHDataDataSetTableAdapters.bedTableAdapter();
                physicianTableAdapter   = new MVCHDataDataSetTableAdapters.physicianTableAdapter();
                patientTableAdapter     = new MVCHDataDataSetTableAdapters.patientTableAdapter();

                //Fill the dataset using a via these 4 table adapters
                //Fill with admission
                admissionsTableAdapter.Fill(physicianPatientDataSet.admissions);
                //Fill with bed
                bedTableAdapter.Fill(physicianPatientDataSet.bed);
                //Fill with physician
                physicianTableAdapter.Fill(physicianPatientDataSet.physician);
                //Fill with patient
                patientTableAdapter.Fill(physicianPatientDataSet.patient);

                //set up the report viewer object on the form to show the runtime report obect
                aPhysicianPatientReport.SetDataSource(physicianPatientDataSet);
                rptCrystalViewerPhysicianPatient.ReportSource = aPhysicianPatientReport;
            }
            catch (Exception dataException)
            {
                //catch any exception thrown during data object instantiation or report generation
                MessageBox.Show("Data Error Encountered: " + dataException.Message);
            }
        }