public ActionResult DiagnosisReportICD(QpsDiagnosisReportICD qpsDiagnosis) { var vm = qpsDiagnosis; if (Request.IsAjaxRequest()) { ReportViewerVm reportVM = new ReportViewerVm(); ReportViewer reportViewer = new ReportViewer(); string reportDocPath = ""; string patientType = ""; DataTable reportData = new DataTable(); reportData = qpsreportDb.getPatientDiagnosisInOrOut(vm.InPatient.ToString(), vm.DepartmentId, vm.CategoryId, vm.CompanyId, vm.StartDate, vm.EndDate.AddDays(1)); if (reportData.Rows.Count == 0) { return(Content(Errors.ReportContent("NO RECORDS FOUND"))); } reportViewer.ProcessingMode = ProcessingMode.Local; if (vm.InPatient.ToString() == "0") //In-Patient { ReportDataSource datasourceItem = new ReportDataSource("InPatient", reportData); reportViewer.LocalReport.DataSources.Add(datasourceItem); patientType = "IN"; reportDocPath = @"\Areas\ManagementReports\Reports\QpsReports\Report_QpsPatientDiagnosisICD_In.rdl"; } else //Out-Patient { ReportDataSource datasourceItem = new ReportDataSource("OutPatient", reportData); reportViewer.LocalReport.DataSources.Add(datasourceItem); patientType = "OUT"; reportDocPath = @"\Areas\ManagementReports\Reports\QpsReports\Report_QpsPatientDiagnosisICD_Out.rdl"; } reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + reportDocPath; reportViewer.LocalReport.SetParameters(new ReportParameter("patientType", patientType)); reportViewer.LocalReport.SetParameters(new ReportParameter("stdate", vm.StartDate.ToString("dd-MMM-yyyy"))); reportViewer.LocalReport.SetParameters(new ReportParameter("endate", vm.EndDate.ToString("dd-MMM-yyyy"))); reportViewer.LocalReport.SetParameters(new ReportParameter("branch", Global.OrganizationDetails.Name + " - " + Global.OrganizationDetails.City.ToUpper())); reportViewer.SizeToReportContent = true; reportViewer.Height = Unit.Percentage(100); reportViewer.Width = Unit.Percentage(100); reportViewer.ShowPrintButton = true; 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(View()); }
public ActionResult DiagnosisReportICD() { var viewModel = new QpsDiagnosisReportICD() { StartDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day), EndDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day), Department = departmentDB.getAllDepartment(), //Company = companyDB.getAllCompany(), Category = categoryDB.getCategories(), }; return(View(viewModel)); }