/// <summary> /// Default Constructor /// </summary> public CurrentPlanDateVsCurrentConfirmationDateForHotJobs() { // Create a new template two object TemplateBlock = new TemplateTwo(); template = TemplateBlock as TemplateTwo; Section = "Current Plan vs Actual"; Name = "Current Plan Date vs Current Confirmation Date For Hot Jobs"; }
/// <summary> /// Export the data from KPAs template two to excel /// </summary> private void ExportTemplateTwoData() { row = (int)OverallExcelFile.OverallCellPositions.KpaOverallTempTwoRowStartPosition; colStart = (int)OverallExcelFile.OverallCellPositions.KpaOverallTempTwoColStartPosition; col = colStart; foreach (KeyPerformanceAction action in KpaOverallReport.Actions) { // Make sure the action is from template one. if (action.TemplateBlock is TemplateTwo) { // Convert the action to a ITemplate interface TemplateTwo tempTwoData = action.TemplateBlock as TemplateTwo; // Get the template data from the action List <string> tempData = tempTwoData.GetTemplateData(); tempData.Add(string.Format("{0:n0}", (action as IFavorable).PercentFavorable + "%")); // 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 value to the cel worksheet.Cells[row, col].Value = double.Parse(data); // Increment the column position ++col; } } // Increament the row pos ++row; } // Reset the column position back to default col = colStart; } }
/// <summary> /// Renders the specific KPA data on the template /// </summary> private void RenderCurrPlanCurrConfDateOpenPO() { Bunifu.DataViz.Canvas canvas = new Bunifu.DataViz.Canvas(); Bunifu.DataViz.DataPoint dp = new Bunifu.DataViz.DataPoint(Bunifu.DataViz.BunifuDataViz._type.Bunifu_column); Title = Values.Categories.kpaCategories[(int)Values.Sections.KpaSection.CurrPlanActual][(int)Values.Categories.KpaCategory.CurrPlanVsActual.CurrPlanDateCurrConfDateOpenPO]; KPA_KPI_UI.topHandleBarModel.Category = Title; KPA_KPI_UI.topHandleBarModel.Section = Values.Sections.kpaSections[(int)Values.Sections.KpaSection.CurrPlanActual]; AnalysisOne = "- Will only show if the PO line has a confirmed date AND is not received complete."; AnalysisTwo = "- Difference between the confirmation date and the current planned date."; TemplateTwo tempTwo = KpaOverallReport.Actions[(int)KpaOption.CurrentPlanVsActual_CurrentPlanDateVsCurrentConfirmationDate].TemplateBlock as TemplateTwo; // Add the data to the column chart dp.addLabely(lbl_xLabelOne.Text, tempTwo.LessthanNegThreeWeeks.ToString()); dp.addLabely(lbl_xLabelTwo.Text, tempTwo.GreaterThanEqualToNegThreeWeeks.ToString()); dp.addLabely(lbl_xLabelThree.Text, tempTwo.GreaterThanEqualToNegThreeWeeks.ToString()); dp.addLabely(lbl_xLabelFour.Text, tempTwo.GreaterThanEqualToNegThreeWeeks.ToString()); dp.addLabely(lbl_xLabelFive.Text, tempTwo.ZeroWeeks.ToString()); dp.addLabely(lbl_xLabelSix.Text, tempTwo.LessThanEqualToOneWeek.ToString()); dp.addLabely(lbl_xLabelSeven.Text, tempTwo.LessThanEqualToTwoWeeks.ToString()); dp.addLabely(lbl_xLabelSeven.Text, tempTwo.LessThanEqualToThreeWeeks.ToString()); dp.addLabely(lbl_xLabelSeven.Text, tempTwo.GreaterThanThreeWeeks.ToString()); Average = string.Format("{0:n}", tempTwo.Average); TimeBucketOne = string.Format("{0:n0}", tempTwo.LessthanNegThreeWeeks); TimeBucketTwo = string.Format("{0:n0}", tempTwo.GreaterThanEqualToNegThreeWeeks); TimeBucketThree = string.Format("{0:n0}", tempTwo.GreaterThanEqualToNegTwoWeeks); TimeBucketFour = string.Format("{0:n0}", tempTwo.GreaterThanEqualNegOneWeek); TimeBucketFive = string.Format("{0:n0}", tempTwo.ZeroWeeks); TimeBucketSix = string.Format("{0:n0}", tempTwo.LessThanEqualToOneWeek); TimeBucketSeven = string.Format("{0:n0}", tempTwo.LessThanEqualToTwoWeeks); TimeBucketEight = string.Format("{0:n0}", tempTwo.LessThanEqualToThreeWeeks); TimeBucketNine = string.Format("{0:n0}", tempTwo.GreaterThanThreeWeeks); TotalOrders = string.Format("{0:n0}", tempTwo.TotalRecords); // Render the column chart canvas.addData(dp); dataviz.Render(canvas); }
public TestDTS() { templateOne = new TemplateOne(); templateTwo = new TemplateTwo(); }
public TestDTS () { templateOne = new TemplateOne (); templateTwo = new TemplateTwo (); }