protected override bool OnBubbleEvent(object source, EventArgs args)
        {
            var handled = false;

            if (args is RefreshGraphEventArgs)
            {
                GraphInformation.RefreshData = true;
                handled = true;
            }

            if (args is ExportToExcelEventArgs)
            {
                GeneralParams.DynamicReportParametersControl.DateRangePickerControl.SetDates(false);

                var siteGroup  = int.Parse(GeneralParams.ExcelExportControl.SelectedGroupBySite);
                var topicId    = int.Parse(GeneralParams.ReportTypeControl.SelectedTopic.Value);
                var scenarioId = int.Parse(GeneralParams.ReportTypeControl.SelectedScenario.SelectedValue);


                Session["ExportData"] = SiteComparisonDataAccess.GetSiteComparisonExcelData(GeneralParams.SelectedParameters, siteGroup, topicId, scenarioId);

                Session["ExportFileName"] = "SiteComparisonExport";

                handled = true;
            }

            return(handled);
        }
        protected void Page_PreRender(object sender, EventArgs e)
        {
            //If this page is being being loaded but we have parameters from a previous visit
            if (!IsPostBack && GraphInformation.SelectedParameters[ParameterNames.Country].Length != 0)
            {
                SetQuickNavigationMenu();
            }

            //Don't allow drilldown past Pool
            if (GraphInformation.ReportParameters.First(p => p.Name == ParameterNames.Pool).SelectedValue != "")
            {
                GraphInformation.AllowDrillDown = false;
            }


            if (GraphInformation.RefreshData || GraphInformation.CheckIfCachedDataCanBeUsed)
            {
                SetQuickNavigationMenu();

                var topicId    = int.Parse(GeneralParams.ReportTypeControl.SelectedTopic.Value);
                var scenarioId = int.Parse(GeneralParams.ReportTypeControl.SelectedScenario.SelectedValue);

                if (topicId > 2)
                {
                    GraphInformation.LabelFormat            = "0%";
                    GraphInformation.DataPointsYAxisTooltip = "#VALY{0%}";
                    GraphInformation.YAxisNumberFormat      = "0%";
                }
                else
                {
                    GraphInformation.LabelFormat            = "#,##0";
                    GraphInformation.DataPointsYAxisTooltip = "#VALY{0,0}";
                    GraphInformation.YAxisNumberFormat      = "#,##0";
                }

                if (SiteComparisonGraphData[CurrentKey] == null || GraphInformation.RefreshData)
                {
                    //SiteComparisonGraphData[CurrentKey] = new SiteComparisonLogic(new SiteComparisonRepository()).GetData(GeneralParams.SelectedParameters, topicId, scenarioId);
                    SiteComparisonGraphData[CurrentKey] =
                        SiteComparisonDataAccess.GetSiteComparisonData(GeneralParams.SelectedParameters, topicId,
                                                                       scenarioId);
                    GraphInformation.DataDate = ParameterDataAccess.GetLastDateFromCmsForecast();
                }
                else
                {
                    GraphInformation.UsingCachedGraphingData = true;
                }

                GraphInformation.SeriesData = SiteComparisonGraphData[CurrentKey];

                if (string.IsNullOrEmpty(GraphInformation.TitleDate))
                {
                    GraphInformation.ShowLabelSeriesNames.Add(GraphInformation.SeriesData.First().SeriesName);
                }

                GraphInformation.TitleDate       = string.Format("{0} - {1}", GeneralParams.SelectedParameters[ParameterNames.FromDate], GeneralParams.SelectedParameters[ParameterNames.ToDate]);
                GraphInformation.TitleAdditional = string.Format("{0}", GeneralParams.ReportTypeControl.SelectedTopic.Text);

                GraphInformation.CalculateYEntriesCount();

                this.SetPreviousDates(GeneralParams);

                GraphInformation.RefreshData = false;
            }
        }