/// <summary> /// Default Constructor /// </summary> public PRsReleased() { // Create a new template object TemplateBlock = new TemplateFive(); template = TemplateBlock as TemplateFive; Section = "Other"; Name = "PRs Released"; }
/// <summary> /// Default Constructor /// </summary> public TotalSpend() { // Create a new template object TemplateBlock = new TemplateFive(); template = TemplateBlock as TemplateFive; Section = "Other"; Name = "Total Spend"; }
/// <summary> /// Default Constructor /// </summary> public HotJobPRs() { // Create a new template object TemplateBlock = new TemplateFive(); template = TemplateBlock as TemplateFive; Section = "Other"; Name = "Hot Jobs PRs"; }
/// <summary> /// Default Constructor /// </summary> public PRValueVsPOValue() { // Create a new template object TemplateBlock = new TemplateFive(); template = TemplateBlock as TemplateFive; Section = "Other"; Name = "PR Value vs PO Value"; }
/// <summary> /// Export the data from KPIs template five to excel /// </summary> private void ExportTemplateFiveData() { row = (int)OverallExcelFile.OverallCellPositions.KpiOverallTempFiveRowStartPosition; colStart = (int)OverallExcelFile.OverallCellPositions.KpiOverallTempFiveColStartPosition; col = colStart; foreach (KeyPerformanceIndicator indicator in KpiOverallReport.Indicators) { // Make sure the indicator is from template one. if (indicator.TemplateBlock is TemplateFive) { // Convert the indicator to a ITemplate interface TemplateFive tempFiveData = indicator.TemplateBlock as TemplateFive; // Get the template data from the indicator List <string> tempData = tempFiveData.GetTemplateData(); // Remove any unwanted characters CleanData(ref tempData); if (tempData != null) { // We are starting at position 2 in the array because the first two value are the section and cateogory // The template already contains this data foreach (string data in tempData) { // if the value in the array is blank, move to the next index in the array if (data == "") { // Increment the column and continue ++col; continue; } // Add the string to the cell worksheet.Cells[row, col].Value = double.Parse(data); // Move to the next column position ++col; } } // Increment the row pos ++row; } // Reset the column position back to default col = colStart; } }
/// <summary> /// Renders the specific KPI category into the loaded template /// </summary> private void RenderThree() { Bunifu.DataViz.Canvas canvas = new Bunifu.DataViz.Canvas(); Bunifu.DataViz.DataPoint dp = new Bunifu.DataViz.DataPoint(Bunifu.DataViz.BunifuDataViz._type.Bunifu_column); Title = Categories.kpiCategories[(int)Sections.KpiSection.Other][(int)Categories.KpiCategory.Other.TotalSpend]; KPA_KPI_UI.topHandleBarModel.Category = Title; KPA_KPI_UI.topHandleBarModel.Section = Sections.kpiections[(int)Sections.KpiSection.Other]; AnalysisOne = "- Value of PO Lines based on PO line Creation Date."; AnalysisTwo = ""; TemplateFive tempFive = KpiOverallReport.Indicators[(int)KpiOption.Other_TotalSpend].TemplateBlock as TemplateFive; // Add the data to the column chart dp.addLabely(lbl_xLabelOne.Text, tempFive.GreaterThanEqualToZeroWeeks.ToString()); dp.addLabely(lbl_xLabelTwo.Text, tempFive.GreaterThanEqualToNegOneWeek.ToString()); dp.addLabely(lbl_xLabelThree.Text, tempFive.GreaterThanEqualToNegTwoWeeks.ToString()); dp.addLabely(lbl_xLabelFour.Text, tempFive.GreaterThanEqualToNegThreeWeeks.ToString()); dp.addLabely(lbl_xLabelFive.Text, tempFive.GreaterThanEqualToNegFourWeeks.ToString()); dp.addLabely(lbl_xLabelSix.Text, tempFive.GreaterThanEqualToNegFiveWeeks.ToString()); dp.addLabely(lbl_xLabelSeven.Text, tempFive.GreaterThanEqualToNegSixWeeks.ToString()); dp.addLabely(lbl_xLabelEight.Text, tempFive.GreaterThanEqualToNegSevenWeeks.ToString()); dp.addLabely(lbl_xLabelNine.Text, tempFive.GreaterThanEqualToNegEightWeeks.ToString()); dp.addLabely(lbl_xLabelTen.Text, tempFive.LessThanNegEightWeeks.ToString()); // Add the data to the time spans TotalValue = string.Format("{0:n0}", tempFive.TotalValue); TimeBucketOne = "$" + string.Format("{0:n}", tempFive.GreaterThanEqualToZeroWeeks); TimeBucketTwo = "$" + string.Format("{0:n}", tempFive.GreaterThanEqualToNegOneWeek); TimeBucketThree = "$" + string.Format("{0:n}", tempFive.GreaterThanEqualToNegTwoWeeks); TimeBucketFour = "$" + string.Format("{0:n}", tempFive.GreaterThanEqualToNegThreeWeeks); TimeBucketFive = "$" + string.Format("{0:n}", tempFive.GreaterThanEqualToNegFourWeeks); TimeBucketSix = "$" + string.Format("{0:n}", tempFive.GreaterThanEqualToNegFiveWeeks); TimeBucketSeven = "$" + string.Format("{0:n}", tempFive.GreaterThanEqualToNegSixWeeks); TimeBucketEight = "$" + string.Format("{0:n}", tempFive.GreaterThanEqualToNegSevenWeeks); TimeBucketNine = "$" + string.Format("{0:n}", tempFive.GreaterThanEqualToNegEightWeeks); TimeBucketTen = "$" + string.Format("{0:n}", tempFive.LessThanNegEightWeeks); TotalOrders = string.Format("{0:n0}", tempFive.TotalRecords); canvas.addData(dp); dataviz.Render(canvas); }
/// <summary> /// Renders the specific KPI category into the loaded template /// </summary> private void RenderFive() { Bunifu.DataViz.Canvas canvas = new Bunifu.DataViz.Canvas(); Bunifu.DataViz.DataPoint dp = new Bunifu.DataViz.DataPoint(Bunifu.DataViz.BunifuDataViz._type.Bunifu_column); Title = Categories.kpiCategories[(int)Sections.KpiSection.Other][(int)Categories.KpiCategory.Other.HotJobPRs]; KPA_KPI_UI.topHandleBarModel.Category = Title; KPA_KPI_UI.topHandleBarModel.Section = Sections.kpiections[(int)Sections.KpiSection.Other]; AnalysisOne = "- Will show for PRs which have Purchase Group of 'UHJ'."; AnalysisTwo = "- Difference between the date the PR was created and todays date."; TemplateFive tempFive = KpiOverallReport.Indicators[(int)KpiOption.Other_HotJobPRs].TemplateBlock as TemplateFive; // Add the data to the column chart dp.addLabely(lbl_xLabelOne.Text, tempFive.GreaterThanEqualToZeroWeeks.ToString()); dp.addLabely(lbl_xLabelTwo.Text, tempFive.GreaterThanEqualToNegOneWeek.ToString()); dp.addLabely(lbl_xLabelThree.Text, tempFive.GreaterThanEqualToNegTwoWeeks.ToString()); dp.addLabely(lbl_xLabelFour.Text, tempFive.GreaterThanEqualToNegThreeWeeks.ToString()); dp.addLabely(lbl_xLabelFive.Text, tempFive.GreaterThanEqualToNegFourWeeks.ToString()); dp.addLabely(lbl_xLabelSix.Text, tempFive.GreaterThanEqualToNegFiveWeeks.ToString()); dp.addLabely(lbl_xLabelSeven.Text, tempFive.GreaterThanEqualToNegSixWeeks.ToString()); dp.addLabely(lbl_xLabelEight.Text, tempFive.GreaterThanEqualToNegSevenWeeks.ToString()); dp.addLabely(lbl_xLabelNine.Text, tempFive.GreaterThanEqualToNegEightWeeks.ToString()); dp.addLabely(lbl_xLabelTen.Text, tempFive.LessThanNegEightWeeks.ToString()); // Add the data to the time spans TotalValue = string.Format("{0:n}", tempFive.TotalValue); TimeBucketOne = string.Format("{0:n0}", tempFive.GreaterThanEqualToZeroWeeks); TimeBucketTwo = string.Format("{0:n0}", tempFive.GreaterThanEqualToNegOneWeek); TimeBucketThree = string.Format("{0:n0}", tempFive.GreaterThanEqualToNegTwoWeeks); TimeBucketFour = string.Format("{0:n0}", tempFive.GreaterThanEqualToNegThreeWeeks); TimeBucketFive = string.Format("{0:n0}", tempFive.GreaterThanEqualToNegFourWeeks); TimeBucketSix = string.Format("{0:n0}", tempFive.GreaterThanEqualToNegFiveWeeks); TimeBucketSeven = string.Format("{0:n0}", tempFive.GreaterThanEqualToNegSixWeeks); TimeBucketEight = string.Format("{0:n0}", tempFive.GreaterThanEqualToNegSevenWeeks); TimeBucketNine = string.Format("{0:n0}", tempFive.GreaterThanEqualToNegEightWeeks); TimeBucketTen = string.Format("{0:n0}", tempFive.LessThanNegEightWeeks); TotalOrders = string.Format("{0:n0}", tempFive.TotalRecords); canvas.addData(dp); dataviz.Render(canvas); }