public ActionResult OPItemBillCount() { var viewModel = new PolyClinicOPItemBillCount() { StartDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day), EndDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day), Services = _clPolyClinicDB.getOPService()//getOPService }; return(View(viewModel)); }
public ActionResult OPItemBillCount(PolyClinicOPItemBillCount viewModel) { if (ModelState.IsValid) { if (Request.IsAjaxRequest()) { var serviceItems = _clPolyClinicDB.getOPBillServiceItemCount(viewModel.StartDate, viewModel.EndDate.AddDays(1), viewModel.StrItemCodes, viewModel.ServiceId); if (serviceItems.Rows.Count > 0) { ReportViewer reportViewer = new ReportViewer(); ReportViewerVm reportVM = new ReportViewerVm(); reportViewer.ProcessingMode = ProcessingMode.Local; reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Areas\ManagementReports\Reports\PolyClinic\OPItemBillCount.rdl"; reportViewer.LocalReport.DataSources.Add(new ReportDataSource("OPItemBillCount", serviceItems)); reportViewer = this.DynamicReportHeader(reportViewer, "DataSet2"); reportViewer.LocalReport.SetParameters(new ReportParameter("startDate", viewModel.StartDate.ToString())); reportViewer.LocalReport.SetParameters(new ReportParameter("endDate", 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)); } else { return(Content(Errors.ReportContent("NO RECORDS FOUND"))); } } } return(Content("")); }