private String GetTitleBase(String prefix, GlobalValues globals, QueryMarshaller qm)
        {
            String regionString = GetRegionString(globals);

            qm.InitLists();

            return(prefix + newline +
                   globals.GetOrgName() + newline +
                   GetYearRangeInTitle(qm.years) + " " +
                   GetCompareToInTitle(globals.OrgLevel,
                                       globals.CompareTo,
                                       globals.STYP,
                                       globals.S4orALL,
                                       regionString)
                   );
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            //show message if the graph is not visible
            pnlMessage.Visible = (Graph.Visible == false);

            DataSetTitle = GetTitleWithoutGroupForSchoolTypeUnsupported(
                ((GlobalValues.WOW.Key == WOWKeys.WSASCombined) ?
                 WOWKeys.WSASCombined : WOWKeys.WKCE)
                + " - " + (
                    (GlobalValues.Grade.Key == GradeKeys.Combined_PreK_12 ||
                     GlobalValues.Grade.Key == GradeKeys.AllDisAgg)
                        ? String.Empty
                        : "Grade "
                    ) + GlobalValues.Grade.Key
                + " - " + GlobalValues.SubjectID.Key + WebSupportingClasses.TitleBuilder.newline
                + GlobalValues.Level.Key
                )
            ;

            DataSetTitle = DataSetTitle.Replace(
                GlobalValues.GetOrgName(),
                GlobalValues.GetOrgName() + "Compared to Other "
                + ((GlobalValues.OrgLevel.Key == OrgLevelKeys.School)? "Schools" : "Districts") + " in "
                + ((GlobalValues.LF.Key == LFKeys.State)? "Entire State" :
                   (GlobalValues.LF.Key == LFKeys.CESA)? "CESA " + GlobalValues.Agency.CESA.Trim() :
                   GlobalValues.Agency.CountyName.Trim()
                   )

                );

            if (GlobalValues.FAYCode.Key == FAYCodeKeys.FAY)
            {
                DataSetTitle = DataSetTitle.Replace(GlobalValues.GetOrgName(), GlobalValues.GetOrgName().Trim() + "  FAY ");
            }

            if (GlobalValues.WOW.Key == WOWKeys.WSASCombined &&
                GlobalValues.Level.Key == LevelKeys.BasicMinSkillEng)
            {
                DataSetTitle = DataSetTitle.Replace("+ WAA SwD/ELL ", String.Empty);
            }

            DataSetTitle =
                DataSetTitle.Replace(TitleBuilder.GetYearRangeInTitle(QueryMarshaller.years),
                                     "November " + (GlobalValues.Year - 1).ToString() + " Data");

            if (GlobalValues.OrgLevel.Key == OrgLevelKeys.School)
            {
                DataSetTitle = DataSetTitle.Replace(TitleBuilder.GetSchoolTypeInTitle(GlobalValues.STYP), String.Empty);
            }

            StateTestsScatterDataGrid.AddSuperHeader(DataSetTitle);
            StateTestsScatterDataGrid.AddSuperHeader(GetSecondSuperHeader());

            List <String> order = QueryMarshaller.BuildOrderByList(DataSet.Tables[0].Columns);

            order.Insert(0, v_WSAS.School_Name);
            order.Insert(0, v_WSAS.District_Name); //same index is intentional... district, then school
            StateTestsScatterDataGrid.OrderBy = String.Join(", ", order.ToArray());

            StateTestsScatterDataGrid.ForceCurrentFloatToTopOrdering = true;

            SetUpChart();

            set_state();
            setBottomLink();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            DataSetTitle = GetTitleWithoutGroupForSchoolTypeUnsupported(
                ((GlobalValues.WOW.Key == WOWKeys.WSASCombined) ?
                 WOWKeys.WSASCombined : WOWKeys.WKCE)
                + " - " + (
                    (GlobalValues.Grade.Key == GradeKeys.Combined_PreK_12 ||
                     GlobalValues.Grade.Key == GradeKeys.AllDisAgg)
                        ? String.Empty
                        : "Grade "
                    ) + GlobalValues.Grade.Key
                + " - " + GlobalValues.SubjectID.Key
                )
            ;

            DataSetTitle = DataSetTitle.Replace(
                GlobalValues.GetOrgName(),
                "Top Five " + ((GlobalValues.OrgLevel.Key == OrgLevelKeys.School) ? "Schools" : "Districts")
                + " in "
                + ((GlobalValues.LF.Key == LFKeys.State) ? "Entire State" :
                   (GlobalValues.LF.Key == LFKeys.CESA) ? "CESA " + GlobalValues.Agency.CESA.Trim() :
                   GlobalValues.Agency.CountyName.Trim()
                   )
                + ((GlobalValues.Sim.Key == SimKeys.Outperform)? " Outperforming " :  " Similar to ")
                + WebSupportingClasses.TitleBuilder.newline + GlobalValues.GetOrgName()
                + WebSupportingClasses.TitleBuilder.newline
                + " Sorted by " + GlobalValues.SORT.Key
                );

            if (GlobalValues.FAYCode.Key == FAYCodeKeys.FAY)
            {
                DataSetTitle = DataSetTitle.Replace(GlobalValues.GetOrgName(), GlobalValues.GetOrgName().Trim() + "  FAY ");
            }

            DataSetTitle =
                DataSetTitle.Replace(TitleBuilder.GetYearRangeInTitle(QueryMarshaller.years),
                                     "November " + (GlobalValues.Year - 1).ToString() + " Data");

            if (GlobalValues.OrgLevel.Key == OrgLevelKeys.School)
            {
                DataSetTitle = DataSetTitle.Replace(TitleBuilder.GetSchoolTypeInTitle(GlobalValues.STYP), String.Empty);
            }

            DataSetTitle = DataSetTitle.Replace(TitleBuilder.GetCompareToInTitle(GlobalValues.OrgLevel, GlobalValues.CompareTo, GlobalValues.STYP, GlobalValues.S4orALL, WebSupportingClasses.TitleBuilder.GetRegionString(GlobalValues)), String.Empty);

            if (GlobalValues.Sim.Key != SimKeys.Default)
            {
                DataSetTitle = DataSetTitle
                               .Replace("Top Five ", "All "
                                        + ((GlobalValues.Sim.Key == SimKeys.AllSimilar) ? String.Empty : "Similar ")
                                        );
            }

            SimilarDataGrid.AddSuperHeader(DataSetTitle);
            SimilarDataGrid.AddSuperHeader(GetSecondSuperHeader());

            SimilarDataGrid.OrderBy = String.Empty; //disable default order by and let SQL take over

            SetUpChart();
            barChart.OrderBy = String.Empty; //disable default order by and let SQL take over
            if (GlobalValues.Sim.Key != SimKeys.Default)
            {
                barChart.Visible = false;
            }

            if (GlobalValues.Sim.Key != SimKeys.Default)
            {
                SimilarDefPanel.Visible = true;
                SimilarDefLabel.Text    = SimilarDefinitionDescription().Replace("\n", "<br />");
            }

            set_state();
            setBottomLink();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (GlobalValues.CompareTo.Key == CompareToKeys.Years &&
                (GlobalValues.SubjectID.Key == SubjectIDKeys.Math ||
                 GlobalValues.SubjectID.Key == SubjectIDKeys.Reading ||
                 GlobalValues.SubjectID.Key == SubjectIDKeys.AllTested)
                )
            {
                pnlNotComparable.Visible = true;
            }


            DataSetTitle = GetTitleForSchoolTypeUnsupported(
                ((GlobalValues.WOW.Key == WOWKeys.WSASCombined) ?
                 "WSAS" : "WKCE") + " - " +
                ((GlobalValues.Grade.Key != GradeKeys.AllDisAgg &&
                  GlobalValues.Grade.Key != GradeKeys.Combined_PreK_12) ?
                 "Grade " : String.Empty) + GlobalValues.Grade.Key +
                " - " + GlobalValues.SubjectID.Key + WebSupportingClasses.TitleBuilder.newline +
                GlobalValues.Level.Key + WebSupportingClasses.TitleBuilder.newline +
                ((GlobalValues.WOW.Key == WOWKeys.WSASCombined) ?
                 WOWKeys.WSASCombined.Replace("WSAS: ", String.Empty) : WOWKeys.WKCE)
                )
            ;

            if (GlobalValues.FAYCode.Key == FAYCodeKeys.FAY)
            {
                DataSetTitle = DataSetTitle.Replace(GlobalValues.GetOrgName(), GlobalValues.GetOrgName() + " FAY");
            }

            if (GlobalValues.WOW.Key == WOWKeys.WSASCombined &&
                GlobalValues.Level.Key == LevelKeys.BasicMinSkillEng)
            {
                DataSetTitle = DataSetTitle.Replace("+ WAA SwD/ELL ", String.Empty);
            }

            //if (GlobalValues.CompareTo.Key != CompareToKeys.Years)
            DataSetTitle =
                DataSetTitle.Replace(TitleBuilder.GetYearRangeInTitle(QueryMarshaller.years),
                                     "November " + (GlobalValues.Year - 1).ToString() + " Data")
            ;

            StateTestsDataGrid.AddSuperHeader(DataSetTitle);

            List <String> order = new List <string>();

            StateTestsDataGrid.OrderBy = barChart.OrderBy = GetCustomOrderBy(order, DataSet.Tables[0].Columns);

            ///*GRAPH*:

            disaggFlags = SetIsDisaggFlags(GlobalValues); //used by CountDimensions() and SetGraphSeriesAndAxisLabelColumns_()

            if (CountDimensions(disaggFlags) > 2)
            {
                HideGraphForDisAggOverflow();
            }
            else
            {
                SetUpGraph();
            }

            set_state();
            setBottomLink();
        }