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"] = NonRevDataAccess.GetFleetComparisonNRExcelData( GeneralParams.SelectedParameters, fleetGroup, topicId, scenarioId); Session["ExportFileName"] = "FleetComparisonNRExport"; 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 (SiteComparisonNRGraphData[CurrentKey] == null || GraphInformation.RefreshData) { SiteComparisonNRGraphData[CurrentKey] = NonRevDataAccess.GetSiteComparisonNRData(GeneralParams.SelectedParameters, topicId, scenarioId); GraphInformation.DataDate = ParameterDataAccess.GetLastDateFromCmsForecast(); } else { GraphInformation.UsingCachedGraphingData = true; } GraphInformation.SeriesData = SiteComparisonNRGraphData[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; } }