예제 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            roomUtilizationReport rpt = new roomUtilizationReport();

            rpt.Site = this.Site;
            return(rpt);
        }
예제 #2
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);
            }
        }