public ActionResult OPProcedureStatistics(PolyClinicProcedureStatistics viewModel) { if (ModelState.IsValid) { if (Request.IsAjaxRequest()) { var data = _clPolyClinicDB.getOPProcedureStatistics(viewModel.StartDate, viewModel.EndDate.AddDays(1)); if (data.Rows.Count > 0) { ReportViewerVm reportVM = new ReportViewerVm(); ReportViewer reportViewer = new ReportViewer(); reportViewer.ProcessingMode = ProcessingMode.Local; if (viewModel.ReportType == ReportType.BARGRAPH) { reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Areas\ManagementReports\Reports\PolyClinic\OPProcedureStatistics_BarGraph.rdlc"; } else if (viewModel.ReportType == ReportType.LINEGRAPH) { reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Areas\ManagementReports\Reports\PolyClinic\OPProcedureStatistics_LineGraph.rdlc"; } else { reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Areas\ManagementReports\Reports\PolyClinic\OPProcedureStatistics_Table.rdlc"; } reportViewer.LocalReport.DataSources.Add(new ReportDataSource("OPProcedureStatistics", data)); reportViewer = this.DynamicReportHeader(reportViewer, "DataSet2"); 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)); } else { return(Content(Errors.ReportContent("NO RECORDS FOUND"))); } } } return(Content("")); }
public ActionResult OPProcedureStatistics() { var viewModel = new PolyClinicProcedureStatistics() { StartDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day), EndDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day), ReportTypeList = new List <KeyValuePair <ReportType, string> >() { new KeyValuePair <ReportType, string>(ReportType.DEFAULT, "Default"), new KeyValuePair <ReportType, string>(ReportType.BARGRAPH, "Bar Graph"), new KeyValuePair <ReportType, string>(ReportType.LINEGRAPH, "Line Graph") }, ReportType = ReportType.DEFAULT }; return(View(viewModel)); }