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 fleetGroup = int.Parse(GeneralParams.ExcelExportControl.SelectedGroupByFleet);
                var topicId    = int.Parse(GeneralParams.ReportTypeControl.SelectedTopic.Value);
                var scenarioId = int.Parse(GeneralParams.ReportTypeControl.SelectedScenario.SelectedValue);

                Session["ExportData"] = FleetComparisonDataAccess.GetFleetComparisonExcelData(GeneralParams.SelectedParameters, fleetGroup, topicId, scenarioId);

                //Session["ExportData"] = new FleetComparisonExcelLogic().GetExcelData(
                //                                        GeneralParams.SelectedParameters, fleetGroup, topicId, scenarioId);

                Session["ExportFileName"] = "FleetComparisonExport";

                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 Car Class Group
            if (GraphInformation.ReportParameters.First(p => p.Name == ParameterNames.CarClassGroup).SelectedValue.Length != 0)
            {
                GraphInformation.AllowDrillDown = false;
            }

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

                var rtSelectionReport = (ReportTypeParameters)GeneralParams.FindControl("rtSelectionReport");
                var topicId           = int.Parse(rtSelectionReport.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 (FleetComparisonGraphData[CurrentKey] == null || GraphInformation.RefreshData)
                {
                    //FleetComparisonGraphData[CurrentKey]=new FleetComparisonLogic(new FleetComparisonRepository()).GetData(GeneralParams.SelectedParameters,topicId,scenarioId);
                    FleetComparisonGraphData[CurrentKey] =
                        FleetComparisonDataAccess.GetFleetComarisonData(GeneralParams.SelectedParameters, topicId,
                                                                        scenarioId);


                    GraphInformation.DataDate = ParameterDataAccess.GetLastDateFromCmsForecast();
                }
                else
                {
                    GraphInformation.UsingCachedGraphingData = true;
                }

                GraphInformation.SeriesData = FleetComparisonGraphData[CurrentKey];

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

                this.SetPreviousDates(GeneralParams);

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

                GraphInformation.RefreshData = false;
            }
        }