private void InitializeReportMetadata(TIRDetailModel model, TIRDetailReportParameter detailReportParameter)
        {
            base.SetNavigationLinksUrl();
            int decimalPlace = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["SiteDecimalPlace"].ToString());

            SiteUser su = ((SiteUser)Session["SiteUser"]);
            ModelServices service = new ModelServices();

            model.SchoolYear = service.SchoolYearDescriptionByYearId(detailReportParameter.Year);

            SetDetailReportUrlData(detailReportParameter);
            UpdateReportTemplateConfigurations(service, detailReportParameter.ReportTemplateId);

            model.AssessmentList = service.GetDetailReportAssessmentList(su.Districts.First().Id, detailReportParameter);
            var list = (model.AssessmentList).Select(x => x.AssessmentDesc).ToList();

            var details = service.GetDetailReport(list, su.Districts.First().Id, detailReportParameter);
            model.details = details;
            model.Subject = service.GetSubjectDescriptionById(detailReportParameter.Subject);

            int[] studentCounts = new int[5];
            decimal[] impactSums = new decimal[5];
            decimal[] avgImpacts = new decimal[5];
            int[] countOfMeetOrExceed = new int[5];
            decimal[] percOfMeetOrExceed = new decimal[5];

            //TODO: Need to handle null check here if no data found in model.details list it will give object refrence not found error.
            studentCounts[0] = model.details.Count(d => d.ScoreData1.Impact != null);
            studentCounts[1] = model.details.Count(d => d.ScoreData2.Impact != null);
            studentCounts[2] = model.details.Count(d => d.ScoreData3.Impact != null);
            studentCounts[3] = model.details.Count(d => d.ScoreData4.Impact != null);
            studentCounts[4] = model.details.Count(d => d.ScoreData5.Impact != null);

            impactSums[0] = model.details.Sum(d => d.ScoreData1.Impact.GetValueOrDefault());
            impactSums[1] = model.details.Sum(d => d.ScoreData2.Impact.GetValueOrDefault());
            impactSums[2] = model.details.Sum(d => d.ScoreData3.Impact.GetValueOrDefault());
            impactSums[3] = model.details.Sum(d => d.ScoreData4.Impact.GetValueOrDefault());
            impactSums[4] = model.details.Sum(d => d.ScoreData5.Impact.GetValueOrDefault());

            for (int i = 0; i < studentCounts.Length; i++)
            {
                if (studentCounts[i] > 0)
                {
                    avgImpacts[i] = Math.Round(impactSums[i] / studentCounts[i], decimalPlace);
                }
            }
            countOfMeetOrExceed[0] = model.details.Where(tirDetail => tirDetail.ScoreData1.Impact >= -2).Count();
            countOfMeetOrExceed[1] = model.details.Where(tirDetail => tirDetail.ScoreData2.Impact >= -2).Count();
            countOfMeetOrExceed[2] = model.details.Where(tirDetail => tirDetail.ScoreData3.Impact >= -2).Count();
            countOfMeetOrExceed[3] = model.details.Where(tirDetail => tirDetail.ScoreData4.Impact >= -2).Count();
            countOfMeetOrExceed[4] = model.details.Where(tirDetail => tirDetail.ScoreData5.Impact >= -2).Count();

            service.IsChildAssessmentsExists(model.AssessmentList);

            for (int i = 0; i < model.AssessmentList.Count; i++)
            {
                if (studentCounts[i] > 0)
                {
                    percOfMeetOrExceed[i] = GetPerOfMeetValue(countOfMeetOrExceed[i], studentCounts[i], true);
                }
            }
            ViewBag.percOfMeetOrExceed = percOfMeetOrExceed;
            ViewBag.studentCounts = studentCounts;
            ViewBag.impactSums = impactSums;
            ViewBag.avgImpacts = avgImpacts;


            var filterParameter = new FilterParameter
            {
                ClassId = detailReportParameter.ClassId,
                Teacher = detailReportParameter.Teacher,
                Year = detailReportParameter.Year,
                Race = detailReportParameter.Race,
                Gender = detailReportParameter.Gender,
                FrlIndicator = detailReportParameter.FrlIndicator,
                IEPIndicator = detailReportParameter.IEPIndicator,
                LEPIndicator = detailReportParameter.LEPIndicator,
                Hispanic = detailReportParameter.Hispanic,
                SchoolYear = model.SchoolYear
            };

            var reportFilterViewModel = ReportsFilterHelper.PopulateReportFilterViewModel(filterParameter, service, su);
            ViewBag.ReportFilters = reportFilterViewModel;
        }