public ActionResult PatientReservationSummary(PolyClinicPatientReservationSummary viewModel) { if (ModelState.IsValid) { var patientnationalitystatisticsModel = _clPolyClinicDB.SummaryPatientReservation(viewModel.EmployeeId.HasValue? viewModel.EmployeeId.Value:0, viewModel.StartDate, viewModel.EndDate.AddDays(1)); ReportViewer reportViewer = new ReportViewer(); ReportViewerVm reportVM = new ReportViewerVm(); reportViewer.ProcessingMode = ProcessingMode.Local; reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Areas\ManagementReports\Reports\PolyClinic\SummaryPatientReservation.rdl"; reportViewer.LocalReport.DataSources.Add(new ReportDataSource("dsSummaryPatientReservation", patientnationalitystatisticsModel)); reportViewer = this.DynamicReportHeader(reportViewer, "DataSet2"); reportViewer.LocalReport.SetParameters(new ReportParameter("stDate", viewModel.StartDate.ToString())); reportViewer.LocalReport.SetParameters(new ReportParameter("enDate", viewModel.EndDate.ToString())); reportViewer.SizeToReportContent = true; reportViewer.Width = Unit.Percentage(100); reportViewer.Height = Unit.Percentage(100); reportVM.ReportViewer = reportViewer; System.Web.HttpContext.Current.Session[Global.ReportViewerSessionName] = reportViewer; System.Web.HttpContext.Current.Session[Global.PdfUriSessionName] = Common.Helper.getApplicationUri("Preview", "Print", null); return(PartialView("~/Views/Shared/_reportViewer.cshtml", reportVM)); } return(Content("")); }
public ActionResult PatientReservationSummary() { var viewModel = new PolyClinicPatientReservationSummary() { StartDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day), EndDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day), PatientTypeList = new List <KeyValuePair <DoctorSchedulePatientType, string> >() { new KeyValuePair <DoctorSchedulePatientType, string>(DoctorSchedulePatientType.ALL, DoctorSchedulePatientType.ALL.ToString()), new KeyValuePair <DoctorSchedulePatientType, string>(DoctorSchedulePatientType.IP, DoctorSchedulePatientType.IP.ToString()), new KeyValuePair <DoctorSchedulePatientType, string>(DoctorSchedulePatientType.OP, DoctorSchedulePatientType.OP.ToString()) } }; return(View(viewModel)); }