Example #1
0
        /// <summary>
        /// Creates a Defect Age graph under analysis folder
        /// </summary>
        /// <param name="analysisItemFolder">AnalysisItemFolder Object</param>
        /// <param name="graphName">Name of the graph</param>
        /// <param name="groupByField">Group by field name</param>
        /// <param name="sumOfField">Sum of field, if this is emplty then count of will be automatically selected</param>
        /// <param name="ageGrouping">Age Grouping Enum object.</param>
        /// <param name="filterString">Filter defects. You can get this using TDFilter Object</param>
        /// <returns></returns>
        public TDAPIOLELib.AnalysisItem CreateDefectAgeGraph(TDAPIOLELib.AnalysisItemFolder analysisItemFolder, String graphName, String groupByField, DefectSummaryGraphSumOF sumOfField, DefectAgeGrouping ageGrouping, String filterString)
        {
            TDAPIOLELib.AnalysisItemFactory analysisItemFactory = analysisItemFolder.AnalysisItemFactory;
            TDAPIOLELib.AnalysisItem        analysisItem        = analysisItemFactory.AddItem(System.DBNull.Value);
            analysisItem.Name = graphName;
            analysisItem.Type = "Graph";

            String SOF = "";

            if (sumOfField.Equals(DefectSummaryGraphSumOF.ActualFixTime))
            {
                SOF = "BG_ACTUAL_FIX_TIME";
            }
            else if (sumOfField.Equals(DefectSummaryGraphSumOF.EstimatedFixTime))
            {
                SOF = "BG_ESTIMATED_FIX_TIME";
            }
            else if (sumOfField.Equals(DefectSummaryGraphSumOF.None))
            {
                SOF = "";
            }
            else
            {
                throw (new Exception("Invalid Defect SumOf Fields"));
            }

            String AG = "";

            if (ageGrouping == DefectAgeGrouping.NoGrouping)
            {
                AG = "All";
            }
            else if (ageGrouping == DefectAgeGrouping.OneMonth)
            {
                AG = "OneMonth";
            }
            else if (ageGrouping == DefectAgeGrouping.OneWeek)
            {
                AG = "OneWeek";
            }
            else if (ageGrouping == DefectAgeGrouping.SixMonths)
            {
                AG = "SixMonth";
            }
            else if (ageGrouping == DefectAgeGrouping.OneYear)
            {
                AG = "OneYear";
            }

            analysisItem.FilterData = GetDefectAgeGraphFilterData(groupByField, SOF, AG, filterString);
            analysisItem.SubType    = "AgeGraph";
            analysisItem.Module     = "defect";
            analysisItem.Post();
            return(analysisItem);
        }
Example #2
0
 /// <summary>
 /// Creates a defect summary report
 /// </summary>
 /// <param name="analysisItemFolder">Folder under which graph should be added</param>
 /// <param name="graphName">Name of the Graph</param>
 /// <param name="groupByField">Group by field</param>
 /// <param name="sumOfField">Sum of field, If this field is left blank then Count will be automatically selected</param>
 /// <param name="xAxisField">XAxis field name</param>
 /// <param name="filterString">filter string </param>
 /// <returns></returns>
 public TDAPIOLELib.AnalysisItem CreateDefectSummaryGraph(TDAPIOLELib.AnalysisItemFolder analysisItemFolder, String graphName, String groupByField, DefectSummaryGraphSumOF sumOfField, String xAxisField, String filterString)
 {
     if (sumOfField.Equals(DefectSummaryGraphSumOF.ActualFixTime))
     {
         return(CreateSummaryGraph(analysisItemFolder, graphName, groupByField, "BG_ACTUAL_FIX_TIME", xAxisField, filterString, "defect"));
     }
     else if (sumOfField.Equals(DefectSummaryGraphSumOF.EstimatedFixTime))
     {
         return(CreateSummaryGraph(analysisItemFolder, graphName, groupByField, "BG_ESTIMATED_FIX_TIME", xAxisField, filterString, "defect"));
     }
     else if (sumOfField.Equals(DefectSummaryGraphSumOF.None))
     {
         return(CreateSummaryGraph(analysisItemFolder, graphName, groupByField, "", xAxisField, filterString, "defect"));
     }
     else
     {
         throw (new Exception("Invalid Defect SumOf Fields"));
     }
 }