public ActionResult ListEmployeeByCategory(PRListOfEmployees param)
        {
            var vm = param;

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

                if (vm.HrId == 0)
                {
                    reportData = personneldb.getEmployeebyCatALL(vm.CategoryId, vm.DeptId, vm.StartDate, vm.EndDate.AddDays(1), vm.GenderId, vm.NationalityId);
                    if (vm.IsWithSalary)
                    {
                        reportDocPath = @"\Areas\ManagementReports\Reports\PersonnelReports\PR_EmployeeByCatALL.rdl";
                    }
                    else
                    {
                        reportDocPath = @"\Areas\ManagementReports\Reports\PersonnelReports\PR_EmployeeByCatALL_NoSalary.rdl";
                    }
                }
                else
                {
                    reportData = personneldb.getEmployeebyCat(vm.HrId, vm.DeptId, vm.StartDate, vm.EndDate.AddDays(1), vm.GenderId, vm.NationalityId);
                    if (vm.IsWithSalary)
                    {
                        reportDocPath = @"\Areas\ManagementReports\Reports\PersonnelReports\PR_EmployeeByCat.rdl";
                    }
                    else
                    {
                        reportDocPath = @"\Areas\ManagementReports\Reports\PersonnelReports\PR_EmployeeByCat_NoSalary.rdl";
                    }
                }

                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("stDate", vm.StartDate.ToShortDateString()));
                reportViewer.LocalReport.SetParameters(new ReportParameter("enDate", vm.EndDate.ToShortDateString()));
                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());
        }
Ejemplo n.º 2
0
        public ActionResult EquipmentBreakdownReport(MaintenanceReportsEquipmentBreakdown maintenanceReportsBreakdown)
        {
            var vm = maintenanceReportsBreakdown;

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

                DataTable reportData = new DataTable();

                // AS per Sir Jericho Table doesnt exist. mcrs made a mdf file that we dont have. so skip this module for now.
                //               Select a.FA_ITEM_NO,b.FA_ITEM_DESCRIPTION,d.DEPT_NAME,
                //case when a.status = 0 then 'Pending/On-Going' when a.status = 1 then 'Completed' else 'Closed' end ItemStatus,
                //a.JR_NO,a.DIAGNOSIS,a.REQ_DATE,a.IMPORTANCE,a.STATUS,a.WORK_TYPE_ID,a.EMP_NO,a.USER_ID
                //--,case when nvl(b.critical,0) = 1 then 'Critical' else 'Non-Critical' end ItemType
                //from MNT_WORK_REQUEST a
                //left join syn_equipment_master_sgh4 b on a.FA_ITEM_NO = b.FA_ITEM_NO
                //left join employee c on a.emp_no = c.emp_no
                //left join depart_ment d on c.department = d.department
                //where a.JR_NO <> 0
            }
            return(View());
        }
        public ActionResult PatientReservationSummary(PolyClinicPatientReservationSummary viewModel)
        {
            if (ModelState.IsValid)
            {
                var patientnationalitystatisticsModel = _clPolyClinicDB.SummaryPatientReservation(viewModel.EmployeeId.HasValue? viewModel.EmployeeId.Value:0, viewModel.StartDate, viewModel.EndDate.AddDays(1));

                ReportViewer   reportViewer = new ReportViewer();
                ReportViewerVm reportVM     = new ReportViewerVm();
                reportViewer.ProcessingMode = ProcessingMode.Local;

                reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Areas\ManagementReports\Reports\PolyClinic\SummaryPatientReservation.rdl";
                reportViewer.LocalReport.DataSources.Add(new ReportDataSource("dsSummaryPatientReservation", patientnationalitystatisticsModel));
                reportViewer = this.DynamicReportHeader(reportViewer, "DataSet2");
                reportViewer.LocalReport.SetParameters(new ReportParameter("stDate", viewModel.StartDate.ToString()));
                reportViewer.LocalReport.SetParameters(new ReportParameter("enDate", 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));
            }


            return(Content(""));
        }
        public ActionResult IPOPCharge(AuditReportIPOPCharged param)
        {
            //SP_GIA_Doctor_Revenue Report_RevenueSummary.rpt
            var vm = param;

            if (Request.IsAjaxRequest())
            {
                ReportViewerVm reportVM      = new ReportViewerVm();
                ReportViewer   reportViewer  = new ReportViewer();
                string         reportDocPath = "";
                DataTable      reportData    = new DataTable();
                int            billtypeId;
                billtypeId = 1;
                int chargetype;
                chargetype = 1;
                if (vm.ChargeType == Enumerations.AuditReport_ChargeType.CHARGED)
                {
                    chargetype = 0;
                }

                if (vm.PackageId == Enumerations.AuditReport_PackageType.NONPACKAGEDEAL)
                {
                    billtypeId = 0;
                }



                reportData = auditDB.getIPOPXrayCharge(vm.StartDate, vm.EndDate.AddDays(1), billtypeId, chargetype);

                reportDocPath = @"\Areas\ManagementReports\Reports\AuditReports\AuditReports_IPOPXray.rdl";

                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("stdate", vm.StartDate.ToShortDateString()));
                reportViewer.LocalReport.SetParameters(new ReportParameter("endate", vm.EndDate.ToShortDateString()));
                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 SummaryOfCancelledAppointments(PolyClinicSummaryOfCancelledAppointments viewModel)
        {
            if (ModelState.IsValid)
            {
                if (Request.IsAjaxRequest())
                {
                    var cancelledReservations = new DataTable();
                    var reportFilePath        = "";
                    if (viewModel.ReportOption == 0)
                    {
                        cancelledReservations = _clPolyClinicDB.getCancelledPatientReservationSummary(viewModel.StartDate, viewModel.EndDate.AddDays(1), viewModel.EmployeeId.HasValue ? viewModel.EmployeeId.Value : 0, (int)viewModel.PatientType);
                        reportFilePath        = @"\Areas\ManagementReports\Reports\PolyClinic\CancelledPatientReservationSummary.rdlc";
                    }
                    else if (viewModel.ReportOption == 1)
                    {
                        cancelledReservations = _clPolyClinicDB.getCancelledPatientReservationSummaryByDoctor(viewModel.StartDate, viewModel.EndDate.AddDays(1), viewModel.DoctorId.HasValue ? viewModel.DoctorId.Value : 0, (int)viewModel.PatientType);
                        reportFilePath        = @"\Areas\ManagementReports\Reports\PolyClinic\CancelledPatientReservationSummaryByDoctor.rdlc";
                    }
                    else
                    {
                        cancelledReservations = _clPolyClinicDB.getCancelledPatientReservationSummaryByDepartment(viewModel.StartDate, viewModel.EndDate.AddDays(1), viewModel.DepartmentId, (int)viewModel.PatientType);
                        reportFilePath        = @"\Areas\ManagementReports\Reports\PolyClinic\CancelledPatientReservationSummaryByDepartment.rdlc";
                    }


                    if (cancelledReservations.Rows.Count > 0)
                    {
                        ReportViewer   reportViewer = new ReportViewer();
                        ReportViewerVm reportVM     = new ReportViewerVm();
                        reportViewer.ProcessingMode = ProcessingMode.Local;

                        reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + reportFilePath;
                        reportViewer.LocalReport.DataSources.Add(new ReportDataSource("dsSummaryPatientReservation", cancelledReservations));
                        reportViewer = this.DynamicReportHeader(reportViewer, "DataSet2");

                        reportViewer.LocalReport.SetParameters(new ReportParameter("stDate", viewModel.StartDate.ToString("dd-MMM-yyyy")));
                        reportViewer.LocalReport.SetParameters(new ReportParameter("enDate", viewModel.EndDate.ToString("dd-MMM-yyyy")));

                        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 CancelledPatientAppointment(PolyClinicListOfCancelledPatientAppointment viewModel)
        {
            if (ModelState.IsValid)
            {
                if (Request.IsAjaxRequest())
                {
                    var operatorId   = viewModel.EmployeeId.HasValue? viewModel.EmployeeId.Value: 0;
                    var doctorId     = viewModel.DoctorId.HasValue? viewModel.DoctorId.Value: 0;
                    var appointments = _clPolyClinicDB.getCancelledPatientReservation(viewModel.StartDate, viewModel.EndDate.AddDays(1), operatorId, doctorId, (int)viewModel.PatientType, viewModel.DepartmentId);

                    if (appointments.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\CancelledPatientAppointmentList.rdlc";
                        reportViewer.LocalReport.DataSources.Add(new ReportDataSource("CancelledPatientAppointments", appointments));
                        reportViewer = this.DynamicReportHeader(reportViewer, "DataSet2");
                        if (viewModel.DoctorId.HasValue)
                        {
                            reportViewer.LocalReport.SetParameters(new ReportParameter("filterDoctor", Boolean.TrueString));
                        }
                        if (viewModel.EmployeeId.HasValue)
                        {
                            reportViewer.LocalReport.SetParameters(new ReportParameter("filterCancelledByEmployee", Boolean.TrueString));
                        }
                        if (viewModel.DepartmentId > 0)
                        {
                            reportViewer.LocalReport.SetParameters(new ReportParameter("filterDepartment", Boolean.TrueString));
                        }
                        if (viewModel.PatientType > 0)
                        {
                            reportViewer.LocalReport.SetParameters(new ReportParameter("filterPatientType", Boolean.TrueString));
                        }


                        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(""));
        }
        public ActionResult OperatorWiseReport(IROperatorWiseReport iroperatorwisereport)
        {
            var vm = iroperatorwisereport;

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

                DataTable reportData = new DataTable();

                reportData = invreportsdb.getIROperatorWiseReport(vm.StartDate, vm.EndDate.AddDays(1), vm.OperatorId, vm.Summary, vm.StationId);

                if (vm.Summary)
                {
                    reportDocPath = @"\Areas\ManagementReports\Reports\InventoryReports\Report_IROperatorWise.rdl";
                }
                else
                {
                    reportDocPath = @"\Areas\ManagementReports\Reports\InventoryReports\Report_IROperatorWiseBreakUp.rdl";
                }

                //sama
                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("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.LocalReport.SetParameters(new ReportParameter("StationID", vm.GenderName));


                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 IncomeYearlySummary(SPIncomeYearlySummary viewModel)
        {
            if (ModelState.IsValid)
            {
                if (Request.IsAjaxRequest())
                {
                    //var data = _clPolyClinicDB.getOPProcedureStatistics(viewModel.StartDate, viewModel.EndDate.AddDays(1));
                    string reportid = viewModel.ReportType.ToString();
                    var    data     = SalesPromoDB.getSPDailyIncomeHistoricalReport(viewModel.StartDate, viewModel.StartDate.AddDays(1), reportid);
                    if (data.Rows.Count > 0)
                    {
                        ReportViewerVm reportVM     = new ReportViewerVm();
                        ReportViewer   reportViewer = new ReportViewer();
                        reportViewer.ProcessingMode = ProcessingMode.Local;

                        //BYOFFICE = 0,
                        //BYDEPARTMENT = 1,
                        //BYDOCTOR = 2

                        if (reportid == "BYOFFICE")//Report_SalesPromotionIncome_Historical
                        {
                            reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Areas\ManagementReports\Reports\SalesPromotion\SPIncomeHostorical.rdl";
                        }
                        else if (reportid == "BYDEPARTMENT") //Report_SalesPromotionIncome_Historical_Dept
                        {
                            reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Areas\ManagementReports\Reports\SalesPromotion\SPIncomeHostorical_Dept.rdl";
                        }
                        else //Report_SalesPromotionIncome_Historical_Doc
                        {
                            reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Areas\ManagementReports\Reports\SalesPromotion\SPIncomeHostorical_Doc.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.StartDate.AddDays(1).ToShortDateString()));
                        reportViewer.LocalReport.SetParameters(new ReportParameter("branch", Global.OrganizationDetails.Name + " - " + Global.OrganizationDetails.City.ToUpper()));

                        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());
        }
Ejemplo n.º 9
0
            public ActionResult EPISBatchPrinting(int EmployeeId)
         {

             
             if (Request.IsAjaxRequest())
             {

                 ReportViewerVm reportVM = new ReportViewerVm();
                 ReportViewer reportViewer = new ReportViewer();
                 string reportDocPath = "";
                 DataTable reportData = new DataTable();

                 reportData = personneldb.getFamilyDependentList(EmployeeId);
                 //Report_DependentList
                 reportDocPath = @"\Areas\ManagementReports\Reports\PersonnelReports\PersonnelReport_EmpDepInformationSheet.rdl";

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

                 var ReportDetails = personneldb.getEmpDetails(EmployeeId);

                 reportViewer.ProcessingMode = ProcessingMode.Local;
                 reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + reportDocPath;
                 ReportDataSource datasourceItem = new ReportDataSource("DataSet1", reportData);
                 reportViewer.LocalReport.DataSources.Add(datasourceItem);
                 reportViewer = this.DynamicReportHeader(reportViewer, "DataSet2");
                 if (ReportDetails.Rows.Count != 0)
                 {
                     foreach (DataRow row in ReportDetails.Rows)
                     {   
                         reportViewer.LocalReport.SetParameters(new ReportParameter("employeeId", Convert.ToString(row["EmployeeID"])));
                         reportViewer.LocalReport.SetParameters(new ReportParameter("employeename", Convert.ToString(row["Name"])));
                         reportViewer.LocalReport.SetParameters(new ReportParameter("employeedepartment", Convert.ToString(row["Department"])));
                         reportViewer.LocalReport.SetParameters(new ReportParameter("employeecontracttype", Convert.ToString(row["ContractType"])));
                         reportViewer.LocalReport.SetParameters(new ReportParameter("employeeposition", Convert.ToString(row["Designation"])));
                         reportViewer.LocalReport.SetParameters(new ReportParameter("employeedatehired", Convert.ToString(row["DateHired"])));
                         reportViewer.LocalReport.SetParameters(new ReportParameter("employeepin", Convert.ToString(row["PIN"])));
                     }
                 }

                 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 PatientCriticalDiagnosis(QpsPatientCriticalDiagnosis qpspatientcritical)
        {
            var vm = qpspatientcritical;

            if (Request.IsAjaxRequest())
            {
                ReportViewerVm reportVM      = new ReportViewerVm();
                ReportViewer   reportViewer  = new ReportViewer();
                string         reportDocPath = "";
                string         headermsg     = "";
                DataTable      reportData    = new DataTable();

                if (vm.stroption == "1")
                {
                    headermsg = vm.strName + " " + vm.EndDate.ToString("dd-MMM-yyyy");
                }
                else if (vm.stroption == "2")
                {
                    headermsg = vm.strName + " " + vm.EndDate.ToString("dd-MMM-yyyy");
                }
                else
                {
                    headermsg  = "Current In-Patient";
                    vm.EndDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
                }

                reportData    = qpsreportDb.getPatientCriticalDiagnosis(vm.EndDate, vm.stroption.ToString());
                reportDocPath = @"\Areas\ManagementReports\Reports\QpsReports\Report_QpsPatientCriticalDiagnosis.rdl";

                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("stdate", vm.E.ToString("dd-MMM-yyyy")));

                reportViewer.LocalReport.SetParameters(new ReportParameter("strName", headermsg));
                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 OPDCancellationByDoctor(PatientStatisticsOPDCancellationByDoctor viewModel)
        {
            if (Request.IsAjaxRequest())
            {
                ReportViewerVm reportVM      = new ReportViewerVm();
                ReportViewer   reportViewer  = new ReportViewer();
                string         reportDocPath = "";

                DataTable reportData = ptStatisticsDB.getOPDCancellation(viewModel.From
                                                                         , viewModel.To.AddDays(1)
                                                                         , viewModel.ServiceId
                                                                         , viewModel.DoctorId
                                                                         , viewModel.SortBy
                                                                         , viewModel.ReasonId);

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


                if (viewModel.GroupByDoctor)
                {
                    reportDocPath = @"\Areas\ManagementReports\Reports\PatientStatistics\OPDCancellationGroupByDoctor.rdl";
                }
                else
                {
                    reportDocPath = @"\Areas\ManagementReports\Reports\PatientStatistics\OPDCancellation.rdl";
                }


                reportViewer.ProcessingMode = ProcessingMode.Local;

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

                ReportDataSource datasourceItem = new ReportDataSource("OPDCancellation", reportData);
                reportViewer.LocalReport.DataSources.Add(datasourceItem);
                reportViewer.LocalReport.SetParameters(new ReportParameter("from", viewModel.From.ToString("dd-MMM-yyyy")));
                reportViewer.LocalReport.SetParameters(new ReportParameter("to", viewModel.To.ToString("dd-MMM-yyyy")));
                reportViewer.LocalReport.SetParameters(new ReportParameter("branch", Global.OrganizationDetails.Name + " - " + Global.OrganizationDetails.City.ToUpper()));
                reportViewer.LocalReport.SetParameters(new ReportParameter("serviceName", viewModel.ServiceId == 0 ? "ALL" : opbServiceDB.getServiceById(viewModel.ServiceId).Name.ToUpper().Trim()));
                reportViewer.LocalReport.SetParameters(new ReportParameter("doctorname", viewModel.DoctorId == 0 ? "ALL": employeeDB.getEmployeeByOperatorId(viewModel.DoctorId).FullName.ToUpper().Trim()));
                reportViewer.SizeToReportContent = true;
                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(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 MagcardEmployee(OtherReportsDateTimeOnly param)
        {
            var    vm                    = param;
            string deptidArray           = Request.Form["DepartmentIdArray"];
            string DepartmentIdArraytext = Request.Form["DepartmentIdArraytext"];

            DepartmentIdArraytext = DepartmentIdArraytext.Substring(1);

            var DeptId = "0";

            if (deptidArray.Contains("0") || deptidArray == null || deptidArray == "")
            {
                DeptId = "0";
            }
            else
            {
                DeptId = deptidArray;
            }
            if (Request.IsAjaxRequest())
            {
                ReportViewerVm reportVM      = new ReportViewerVm();
                ReportViewer   reportViewer  = new ReportViewer();
                string         reportDocPath = "";
                DataTable      reportData    = new DataTable();

                reportData    = helpdeskDB.getMagcard(vm.StartDate, vm.EndDate.AddDays(1), DeptId, "[MCRS].[Helpdesk_DutyRosterMissingWithHRCategory]");
                reportDocPath = @"\Areas\ManagementReports\Reports\HelpDeskReports\HelpDeskMissingDutyRosterReport.rdl";

                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("sdate", vm.StartDate.ToString("MMMM-yyyy")));
                reportViewer.LocalReport.SetParameters(new ReportParameter("endate", vm.EndDate.ToString("MMMM-yyyy")));
                reportViewer.LocalReport.SetParameters(new ReportParameter("catname", DepartmentIdArraytext));
                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 DailyPerformanceActualVsBudget(SalesPromotionDailyPerformanceActBudget viewModel)
        {
            if (ModelState.IsValid)
            {
                if (Request.IsAjaxRequest())
                {
                    //var data = _clPolyClinicDB.getOPProcedureStatistics(viewModel.StartDate, viewModel.EndDate.AddDays(1));

                    // connncection in  ReportDoc.SetDatabaseLogon("sghit", "SGHIT", "130.1.2.223", "BI")
                    var data = SalesPromoDB.getDailyActualvsBudget(Request.Form["startdate"], viewModel.EndDate.AddDays(1), viewModel.BranchId);
                    if (data.Rows.Count > 0)
                    {
                        ReportViewerVm reportVM     = new ReportViewerVm();
                        ReportViewer   reportViewer = new ReportViewer();
                        reportViewer.ProcessingMode = ProcessingMode.Local;

                        if (viewModel.BranchId == "SGH_JEDDAH")
                        {
                            reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Areas\ManagementReports\Reports\SalesPromotion\SPIncomeHostorical.rdl";
                        }
                        else if (viewModel.BranchId == "BYDEPARTMENT")
                        {
                            reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Areas\ManagementReports\Reports\SalesPromotion\SPIncomeHostorical_Dept.rdl";
                        }
                        else
                        {
                            reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Areas\ManagementReports\Reports\SalesPromotion\SPIncomeHostorical_Doc.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.StartDate.AddDays(1).ToShortDateString()));
                        reportViewer.LocalReport.SetParameters(new ReportParameter("branch", Global.OrganizationDetails.Name + " - " + Global.OrganizationDetails.City.ToUpper()));

                        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());
        }
Ejemplo n.º 15
0
        public ActionResult xrayreferral(RadiologyReportXrayReferral param)
        {
            //SP SP_Get_XrayfromER Report_Radiology.rpt
            var vm = param;

            if (Request.IsAjaxRequest())
            {
                var xrayreferral = radiologyDB.getXrayReferral(param.StartDate, param.EndDate.AddDays(1));


                ReportViewerVm reportVM      = new ReportViewerVm();
                ReportViewer   reportViewer  = new ReportViewer();
                string         reportDocPath = "";
                DataTable      reportData    = new DataTable();



                reportData = radiologyDB.getXrayReferral(vm.StartDate, vm.EndDate.AddDays(1));

                reportDocPath = @"\Areas\ManagementReports\Reports\RadiologyReports\XrayReferral.rdl";

                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);

                //For Dynamic Report Header
                OtherReportsDB otherReprtDB = new OtherReportsDB();
                DataTable      reportHeader = new DataTable();
                reportHeader = otherReprtDB.getReportHeader2018();
                ReportDataSource datareportheaderitem = new ReportDataSource("ReportHeader2018", reportHeader);
                reportViewer.LocalReport.DataSources.Add(datareportheaderitem);


                reportViewer.LocalReport.SetParameters(new ReportParameter("stdate", param.StartDate.ToShortDateString()));
                reportViewer.LocalReport.SetParameters(new ReportParameter("endate", param.EndDate.ToShortDateString()));
                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 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 OPPatientCount(PolyClinicOPPatientCount viewModel)
        {
            if (Request.IsAjaxRequest())
            {
                var opdpatientcountModel = _clPolyClinicDB.OPPatientCount(viewModel.StartDate.ToString("dd-MMM-yyyy"), viewModel.EndDate.AddDays(1).ToString("dd-MMM-yyyy"), (int)viewModel.OPDSelection);

                if (opdpatientcountModel.Rows.Count > 0)
                {
                    ReportViewerVm reportVM     = new ReportViewerVm();
                    ReportViewer   reportViewer = new ReportViewer();
                    reportViewer.ProcessingMode = ProcessingMode.Local;
                    var description = "";
                    if (viewModel.OPDSelection == OPDSelectionCount.PATIENTVISITCOUNT)
                    {
                        description = "Number of Patient Visited the Hospital Report";
                    }
                    else if (viewModel.OPDSelection == OPDSelectionCount.PATIENTREVISITCOUNT)
                    {
                        description = "Patient Revisit Against Total Number/Department Report";
                    }
                    else
                    {
                        description = "Number of New Patients Visited the Hospital Report";
                    }

                    reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Areas\ManagementReports\Reports\PolyClinic\OpPatientVisitCount.rdl";
                    reportViewer.LocalReport.SetParameters(new ReportParameter("FromDate", viewModel.StartDate.ToString("dd-MMM-yyyy")));
                    reportViewer.LocalReport.SetParameters(new ReportParameter("ToDate", viewModel.EndDate.ToString("dd-MMM-yyyy")));
                    reportViewer.LocalReport.SetParameters(new ReportParameter("Label", description));

                    reportViewer.LocalReport.DataSources.Add(new ReportDataSource("dsOPDPatientCount", opdpatientcountModel));
                    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 RECORD FOUND")));
                }
            }


            return(Content(""));
        }
        public ActionResult OPCancelledBillByDept(AuditReportsIPCancelledByDept param)
        {
            var vm = param;

            if (Request.IsAjaxRequest())
            {
                ReportViewerVm reportVM      = new ReportViewerVm();
                ReportViewer   reportViewer  = new ReportViewer();
                string         reportDocPath = "";
                DataTable      reportData    = new DataTable();
                int            billtypeId;
                billtypeId = 0;

                if (vm.BillType == Enumerations.AuditReport_IpCancelledByDept.CHARGE)
                {
                    billtypeId = 1;
                }

                if (vm.BillType == Enumerations.AuditReport_IpCancelledByDept.BOTH)
                {
                    billtypeId = 2;
                }

                reportData = auditDB.getOPCancelledBillByDept(vm.StartDate, vm.EndDate.AddDays(1), billtypeId);

                reportDocPath = @"\Areas\ManagementReports\Reports\AuditReports\getOPCancelledBillByDept.rdl";

                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("stdate", vm.StartDate.ToShortDateString()));
                reportViewer.LocalReport.SetParameters(new ReportParameter("endate", vm.EndDate.ToShortDateString()));
                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());
        }
Ejemplo n.º 19
0
        public ActionResult NoOfCashVisit(MRCashPatientVisit viewmodel)
        {
            var vm = viewmodel;

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

                DataTable reportData = new DataTable();

                reportData    = marketDB.getNoOfCashVisit(vm.StartDate, vm.EndDate.AddDays(1), viewmodel.NoVisit);
                reportDocPath = @"\Areas\ManagementReports\Reports\MarketingReports\CashPatientVisit.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", viewmodel.StartDate.ToString("dd/MM/yyyy")));
                reportViewer.LocalReport.SetParameters(new ReportParameter("enDate", viewmodel.EndDate.ToShortDateString()));
                reportViewer.LocalReport.SetParameters(new ReportParameter("xNoVisit", viewmodel.NoVisit.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());
        }
Ejemplo n.º 20
0
        public ActionResult AramcoPatient(MRAramcoPatient viewmodel)
        {
            viewmodel.Gender = sexdb.getSex();
            var vm = viewmodel;

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

                DataTable reportData = new DataTable();
                reportData    = marketDB.getAramcoPatient(viewmodel.From, viewmodel.To, (int)viewmodel.SexID);
                reportDocPath = @"\Areas\ManagementReports\Reports\MarketingReports\AramcoPatientByAge.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("between", viewmodel.From.ToString()));
                reportViewer.LocalReport.SetParameters(new ReportParameter("to", viewmodel.To.ToString()));
                reportViewer.LocalReport.SetParameters(new ReportParameter("category", viewmodel.GenderName));
                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());
        }
        public ActionResult SurgeryRecordSummary(OperationTheatreSurgeryRecordSummary viewModel)
        {
            if (Request.IsAjaxRequest())
            {
                ReportViewerVm reportVM      = new ReportViewerVm();
                ReportViewer   reportViewer  = new ReportViewer();
                string         reportDocPath = "";

                DataTable reportData = otOrderDB.getSurgeryRecordSummary(viewModel.From, viewModel.To.AddDays(1), viewModel.DoctorId, viewModel.DepartmentId, viewModel.SortMode, viewModel.IsWithQty);

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


                if (viewModel.IsWithQty)
                {
                    reportDocPath = @"\Areas\ManagementReports\Reports\OperationTheatre\RptSurgeryRecordSummaryWithQty.rdl";
                }
                else
                {
                    reportDocPath = @"\Areas\ManagementReports\Reports\OperationTheatre\RptSurgeryRecordSummary.rdl";
                }


                //reportDocPath = @"\Areas\ManagementReports\Reports\OperationTheatre\RptSurgeryRecordSummary_final.rdl";


                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("from", viewModel.From.ToString("dd-MMM-yyyy")));
                reportViewer.LocalReport.SetParameters(new ReportParameter("to", viewModel.To.ToString("dd-MMM-yyyy")));
                reportViewer.LocalReport.SetParameters(new ReportParameter("aaaCompanyName", Global.OrganizationDetails.Name + " - " + Global.OrganizationDetails.City.ToUpper()));
                reportViewer.SizeToReportContent = true;
                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 CensusAndGraphs(SPCensusGraphs viewModel)
        {
            if (ModelState.IsValid)
            {
                if (Request.IsAjaxRequest())
                {
                    //var data = _clPolyClinicDB.getOPProcedureStatistics(viewModel.StartDate, viewModel.EndDate.AddDays(1));
                    var data = SalesPromoDB.getSPCensusGraph(viewModel.StartDate, viewModel.EndDate.AddDays(1), viewModel.CategoryId);
                    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\SalesPromotion\SPCensusGraphs_BarGraph.rdl";
                        }
                        else if (viewModel.ReportType == ReportType.LINEGRAPH)
                        {
                            reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Areas\ManagementReports\Reports\SalesPromotion\SPCensusGraphs_LineGraph.rdl";
                        }
                        else
                        {
                            reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Areas\ManagementReports\Reports\SalesPromotion\SPCensusGraphs_Table.rdl";
                        }

                        reportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", data));
                        reportViewer.LocalReport.SetParameters(new ReportParameter("categoryname", viewModel.CategoryName));
                        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());
        }
Ejemplo n.º 23
0
        public ActionResult PassportDetailsReport(PRListOfEmployees param)
        {

            var vm = param;
            if (Request.IsAjaxRequest())
            {

                ReportViewerVm reportVM = new ReportViewerVm();
                ReportViewer reportViewer = new ReportViewer();
                string reportDocPath = "";
                DataTable reportData = new DataTable();

                //    ViewReport("SP_GetEmployeebyCategoryAllwithPassport  " & xcat & "," & xdeptcat & ",'" & FormatDatePlus(stDate.Value, "DD_MMM_YYYY") & "','" & FormatDatePlus(enDate.Value, "DD_MMM_YYYY") & "'," & CType(cboGender.SelectedItem, ValueDescriptionPair).Value())
                //Report_PassportDetailList

                reportData = personneldb.getEmployeePassportDetail( vm.DeptId, vm.StartDate, vm.EndDate.AddDays(1), vm.GenderId);

                reportDocPath = @"\Areas\ManagementReports\Reports\PersonnelReports\getEmployeePassportDetail.rdl";
                 

                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 = this.DynamicReportHeader(reportViewer, "DataSet2");
                reportViewer.LocalReport.SetParameters(new ReportParameter("stDate", vm.StartDate.ToShortDateString()));
                reportViewer.LocalReport.SetParameters(new ReportParameter("enDate", vm.EndDate.ToShortDateString()));
                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 PatientListByAge(QpsPatientListByAge QpsPatientList)
        {
            var vm = QpsPatientList;

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

                reportData    = qpsreportDb.getPatientListByAge(vm.AgeRangeID, vm.checkDate, vm.StartDate, vm.EndDate.AddDays(1));
                reportDocPath = @"\Areas\ManagementReports\Reports\QpsReports\Report_QpsPatientListByAge.rdl";

                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("stdate", vm.StartDate.ToString("dd-MMM-yyyy")));
                //reportViewer.LocalReport.SetParameters(new ReportParameter("endate", vm.EndDate.ToString("dd-MMM-yyyy")));
                reportViewer.LocalReport.SetParameters(new ReportParameter("rangename", vm.AgeRangeName.ToString()));
                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());

//            [MCRS].[QpsReport_GetPatientListByAge]
//(@stAge int, @enAge int, @xOption int, @regSTDate datetime, @regENDate datetime)
        }
        public ActionResult MrdAdmissionDischargeStats(MrdAdmissionDischargeStats MrdAdminDischarStats)
        {
            var vm = MrdAdminDischarStats;

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


                reportData    = qpsreportDb.getMrdAdmissionDischargeStats(vm.StartDate, vm.EndDate.AddDays(1), vm.RepType);
                reportDocPath = @"\Areas\ManagementReports\Reports\QpsReports\Report_QpsMrdAdmissionDischargeStats.rdl";

                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("startdate", vm.StartDate.ToString("dd-MMM-yyyy")));
                reportViewer.LocalReport.SetParameters(new ReportParameter("enddate", vm.EndDate.ToString("dd-MMM-yyyy")));
                reportViewer.LocalReport.SetParameters(new ReportParameter("reptype", vm.RepType.ToString()));
                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 OPBilledReport(AuditReportIPChargeBilledReport param)
        {
            var vm = param;

            if (Request.IsAjaxRequest())
            {
                ReportViewerVm reportVM      = new ReportViewerVm();
                ReportViewer   reportViewer  = new ReportViewer();
                string         reportDocPath = "";
                DataTable      reportData    = new DataTable();
                int            withDoc       = 1;
                //if (vm.DocOrNone == true)
                //{ withDoc = 0; }
                reportData    = auditDB.getOPBillCharge(vm.StartDate, vm.EndDate.AddDays(1), vm.DoctorId, vm.ServiceId, vm.CategoryId, vm.CompanyId, vm.AccountType, vm.ChargedORBilled);
                reportDocPath = @"\Areas\ManagementReports\Reports\AuditReports\AuditReport_OPBilledReport.rdl";

                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("startdate", vm.StartDate.ToShortDateString()));
                reportViewer.LocalReport.SetParameters(new ReportParameter("enddate", vm.EndDate.ToShortDateString()));
                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());
        }
Ejemplo n.º 27
0
        public ActionResult ExpireIqama(OtherReportsDateTimeOnly param)
        {
            //SP_Get_Iquama_Epiry   Report_EmployeebyExpiringIquama.rpt
            var vm = param;
            if (Request.IsAjaxRequest())
            {

                ReportViewerVm reportVM = new ReportViewerVm();
                ReportViewer reportViewer = new ReportViewer();
                string reportDocPath = "";
                DataTable reportData = new DataTable();

                reportData = OtherReportDB.getStartEndDateandSP(vm.StartDate, vm.EndDate.AddDays(1), "[MCRS].[PersonnelReports_GetIqamaExpiry]");
                reportDocPath = @"\Areas\ManagementReports\Reports\PersonnelReports\PersonnelReports_GetIqamaExpiry.rdl";

                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 = this.DynamicReportHeader(reportViewer, "DataSet2");
                reportViewer.LocalReport.SetParameters(new ReportParameter("stdate", vm.StartDate.ToShortDateString()));
                reportViewer.LocalReport.SetParameters(new ReportParameter("endate", vm.EndDate.ToShortDateString()));
                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 StaffContractDetailsReport(HRDStaffContractDetails param)
        {
            //SP_GET_EMPCONTRACT_INFO  " & xDept & "," & xPos & "")
            var vm = param;

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

                reportData    = humanresourcesdb.getStaffContractDetails(vm.DepartmentId, vm.PositionId);
                reportDocPath = @"\Areas\ManagementReports\Reports\HumanResourcesReports\HRD_GetStaffContractDetails.rdl";

                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("stdate", param.StartDate.ToShortDateString()));
                //reportViewer.LocalReport.SetParameters(new ReportParameter("endate", param.EndDate.ToShortDateString()));
                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 DailyCensus(SPCensusGraphs viewModel)
        {
            if (ModelState.IsValid)
            {
                if (Request.IsAjaxRequest())
                {
                    //var data = _clPolyClinicDB.getOPProcedureStatistics(viewModel.StartDate, viewModel.EndDate.AddDays(1));
                    var data = SalesPromoDB.getDailyCensus(viewModel.StartDate, viewModel.StartDate.AddDays(1));
                    if (data.Rows.Count > 0)
                    {
                        ReportViewerVm reportVM     = new ReportViewerVm();
                        ReportViewer   reportViewer = new ReportViewer();
                        reportViewer.ProcessingMode = ProcessingMode.Local;

                        reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Areas\ManagementReports\Reports\SalesPromotion\SPDailyCensus.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.StartDate.AddDays(1).ToShortDateString()));
                        reportViewer.LocalReport.SetParameters(new ReportParameter("branch", Global.OrganizationDetails.Name + " - " + Global.OrganizationDetails.City.ToUpper()));

                        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 EmployeeWise(HRDStaffContractDetails param)
        {
            var vm = param;

            if (Request.IsAjaxRequest())
            {
                string         fromtext      = Request.Form["SelectedCategoryText"];
                ReportViewerVm reportVM      = new ReportViewerVm();
                ReportViewer   reportViewer  = new ReportViewer();
                string         reportDocPath = "";
                DataTable      reportData    = new DataTable();

                reportData    = humanresourcesdb.getIndividualEmplEval(vm.EvaluationDate);
                reportDocPath = @"\Areas\ManagementReports\Reports\HumanResourcesReports\HRD_GetIndivEmpEval.rdl";

                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("fromtext", fromtext.ToString()));
                //reportViewer.LocalReport.SetParameters(new ReportParameter("endate", param.EndDate.ToShortDateString()));
                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());
        }