コード例 #1
0
        public ActionResult ClinicalTimeAnalysis()
        {
            var viewModel = new DAClinicalTimeAnalysis()
            {
                StartDate      = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day),
                EndDate        = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day),
                DepartmentList = departmentDB.getAllDepartmentByDistinct(),
            };

            return(View(viewModel));
        }
コード例 #2
0
        public ActionResult ClinicalTimeAnalysis(DAClinicalTimeAnalysis viewmodel)
        {
            var vm = viewmodel;

            if (Request.IsAjaxRequest())
            {
                //sama
                ReportViewerVm reportVM      = new ReportViewerVm();
                ReportViewer   reportViewer  = new ReportViewer();
                string         reportDocPath = "";

                DataTable reportData = new DataTable();

                reportData    = DoctorAnalysisDB.getDoctorClinicalAnalysis(vm.StartDate, vm.EndDate.AddDays(1), vm.DoctorId);
                reportDocPath = @"\Areas\ManagementReports\Reports\DoctorAnalysis\DoctorClinicalAnalysis.rdl";

                DateTime dateTime = DateTime.Today;

                if (reportData.Rows.Count == 0)
                {
                    return(Content(Errors.ReportContent("NO RECORDS FOUND")));
                }

                reportViewer.ProcessingMode = ProcessingMode.Local;

                reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + reportDocPath;

                ReportDataSource datasourceItem = new ReportDataSource("DataSet1", reportData);
                reportViewer.LocalReport.DataSources.Add(datasourceItem);
                reportViewer.LocalReport.SetParameters(new ReportParameter("branch", Global.OrganizationDetails.Name + " - " + Global.OrganizationDetails.City.ToUpper()));
                reportViewer.LocalReport.SetParameters(new ReportParameter("stDate", vm.StartDate.ToString("dd/MM/yyyy")));
                reportViewer.LocalReport.SetParameters(new ReportParameter("enDate", vm.EndDate.ToShortDateString()));
                reportViewer.LocalReport.SetParameters(new ReportParameter("DoctorName", vm.DoctorName.ToString()));
                //reportViewer.LocalReport.SetParameters(new ReportParameter("printdate", dateTime.ToString("dd/MM/yyyy")));
                //reportViewer.LocalReport.SetParameters(new ReportParameter("printtime", dateTime.ToString("H:i:s")));
                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());
        }