public ActionResult DailyIncomeDetails(SPDailyIncome viewModel)
        {
            if (ModelState.IsValid)
            {
                if (Request.IsAjaxRequest())
                {
                    ReportViewerVm reportVM     = new ReportViewerVm();
                    ReportViewer   reportViewer = new ReportViewer();
                    reportViewer.ProcessingMode = ProcessingMode.Local;


                    //var data = _clPolyClinicDB.getOPProcedureStatistics(viewModel.StartDate, viewModel.EndDate.AddDays(1));
                    string reportid = viewModel.ReportType.ToString();
                    var    data     = SalesPromoDB.getSPDailyIncome(viewModel.StartDate, viewModel.EndDate.AddDays(1), reportid);
                    if (data.Rows.Count > 0)
                    {
                        if (viewModel.ReportType == ReportCategoryType.DEPARTMENT)
                        {
                            return(Content(Errors.ReportContent("NO WHCIT.VW_SalesPromotion   ")));
                            // reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Areas\ManagementReports\Reports\SalesPromotion\SPDailyIncome_Dept.rdl";
                        }
                        else if (viewModel.ReportType == ReportCategoryType.GOVOFFICE)
                        {
                            return(Content(Errors.ReportContent("NO WHCIT.VW_SalesPromotion   ")));
                            //reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Areas\ManagementReports\Reports\SalesPromotion\SPDailyIncome_Gov.rdl";
                        }
                        else
                        {
                            reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Areas\ManagementReports\Reports\SalesPromotion\SPDailyIncome.rdl";
                        }

                        reportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", data));
                        reportViewer.LocalReport.SetParameters(new ReportParameter("stDate", viewModel.StartDate.ToShortDateString()));
                        reportViewer.LocalReport.SetParameters(new ReportParameter("enDate", viewModel.EndDate.ToShortDateString()));
                        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(View());
        }
        public ActionResult DailyIncomeDetails()
        {
            var viewModel = new SPDailyIncome()
            {
                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 <ReportCategoryType, string> >()
                {
                    new KeyValuePair <ReportCategoryType, string>(ReportCategoryType.ALLPATIENT, "By All Patient"),
                    new KeyValuePair <ReportCategoryType, string>(ReportCategoryType.GOVOFFICE, "By Government Office"),
                    new KeyValuePair <ReportCategoryType, string>(ReportCategoryType.DEPARTMENT, "By Department")
                },
                ReportType   = ReportCategoryType.ALLPATIENT,
                CategoryList = MohDB.getMOHCategories()
            };

            return(View(viewModel));
        }