Пример #1
0
        //SMC
        public ActionResult SMC(string FacilityCode, string sdate, string edate)
        {
            int x = 0;
            //Boolean y = false;
            ReportsModel obj = new ReportsModel();

            if (int.TryParse(FacilityCode, out x))
            {
                obj.FacilityCode = System.Convert.ToInt32(FacilityCode);
            }

            DateTime?StartDate = DateTime.ParseExact(sdate, "dd/MM/yyyy", null);
            DateTime?EndDate   = DateTime.ParseExact(edate, "dd/MM/yyyy", null);

            obj.StartDate = StartDate;
            obj.EndDate   = EndDate;
            Microsoft.Reporting.WebForms.ReportViewer reportViewer = new Microsoft.Reporting.WebForms.ReportViewer();
            reportViewer.ProcessingMode      = ProcessingMode.Local;
            reportViewer.SizeToReportContent = true;
            //reportViewer.Width = Unit.Percentage(900);
            //reportViewer.Height = Unit.Percentage(900);

            //List<spView_Admin_Calender_ScheduleAppointmentsGetAll_Result> titles = obj.GetDetailedReport();

            reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Reports\Report_WebTemplate_SMC_SLM.rdlc";
            reportViewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("ds_consumption", obj.SMC().ToList()));
            reportViewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("ds_header", obj.SMC_Header().ToList()));

            ViewBag.ReportViewer = reportViewer;
            return(View());
        }