Create a rollup of % complete of all task in a project

Frage Create a rollup of % complete of all task in a project

  • 24 kwietnia 2012 15:05
     
      Zawiera kod

    I have been task to change a custom webpart in PWA 2007 that gives you an "overall % complete for last week and this week. The current code works find but it is counting the number of rows that are complete but the client would like to use the % work complete field in the summary task to come up with the overall percentage complete for the project.  In addition they would like for us to change it to bi-weekly instead of weekly. What is the best way to approach this. 

    taskRows = projectDS.Task.Select(projectDS.Task.TASK_ACT_FINISHColumn.ColumnName + " <='#" + previousWeekEnd.ToShortDateString() + "#'");
                                double lastweekcompletion = 0;
                                foreach (DataRow drtask in taskRows)
                                {
                                    if (drtask[projectDS.Task.TASK_PCT_COMPColumn.ColumnName].ToString() == "100")
                                       lastweekcompletion++;
                                }
                                drNewProject["OverAllLastWeek"] = Math.Round(((lastweekcompletion / totaltaskRows) * 100), 2).ToString() + "%";
                                double currentweekcompletion = 0;
                          taskRows = projectDS.Task.Select(projectDS.Task.TASK_ACT_FINISHColumn.ColumnName + " <='#" + dtCurrentWeekend.ToShortDateString() + "#'");
                                foreach (DataRow drtask in taskRows)
                                {
                                    if (drtask[projectDS.Task.TASK_PCT_COMPColumn.ColumnName].ToString() == "100")
                                        currentweekcompletion++;
                                }
                                drNewProject["OverAllThisWeek"] = Math.Round(((currentweekcompletion / totaltaskRows) * 100), 2).ToString() + "%";
                                dtDivProjects.Rows.Add(drNewProject);
                                dtRisksIssues.Rows.Add(drRiskIssue);


    • Zmodyfikowany przez cmct 24 kwietnia 2012 19:42
    •