public ActionResult PC_HIVTEST(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_PC_WebTemplate_Laboratory.rdlc"; reportViewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("test_kit_pc", obj.GetPC_HIV().ToList())); reportViewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("lab_pc", obj.GetPC_Lab().ToList())); ViewBag.ReportViewer = reportViewer; return(View()); }