2014-09-03 56 views
0

我目前正在使用Project Server 2013,PWA和Project 2013 Pro。我正在嘗試創建儀表板,並且需要在沒有預算或與其相關的成本的項目中計劃完成%。尋找自定義過濾器比模擬狀態報告的「更新項目」

這意味着我必須創建一個自定義過濾器,它將模擬項目狀態選項卡中的更新項目按鈕。

有沒有其他人不得不這樣做,或者你能否提供我可以使用的替代方案?

回答

0

我寫了類似的東西在2010年做到這一點 - 我認爲它會在2013年工作,雖然不能測試它。

雖然您沒有任何預算或成本,但我假設您確實有一段時間的基線。既然如此,下面的代碼將輸出計劃的完成百分比(即,您應在一個給定的任務由狀態日期燒燬小時的比例)到現場text11

Option Explicit 
Sub CalcBaselinePerctComplete() 
Dim pj As Project 
Dim t As Task 
Dim TSV As TimeScaleValue 
Dim TSVs As TimeScaleValues 
Dim HrsValue As Double 
Dim PerctValue As Integer 
Set pj = ActiveProject 
For Each t In pj.Tasks 
    Select Case pj.StatusDate 
     Case Is > t.BaselineFinish 
      'If the baseline end date is in the past, then the PerctValue must be 100% 
      'so no need to loop through the time scaled PerctValues 
      PerctValue = 100 
     Case Is < t.BaselineStart 
      'If the baseline start date is in the future, then the PerctValue must be 0% 
      'so no need to loop through the time scaled PerctValues 
      PerctValue = 0 
     Case Else 
      If t.BaselineWork = 0 Then 
       'if there is no baseline work, then the PerctValue must be 1005 
       'otherwise we've be dividing by zero 
       PerctValue = 100 
      Else 
       Set TSVs = t.TimeScaleData(t.Start, pj.StatusDate, pjTaskTimescaledBaselineWork, pjTimescaleDays) 
       HrsValue = 0 
       For Each TSV In TSVs 
        If TSV.Value <> "" Then 
         HrsValue = HrsValue + TSV.Value 
        End If 
       Next TSV 
       PerctValue = HrsValue/t.BaselineWork * 100 
      End If 
    End Select 
SetValue: 
t.Text11 = PerctValue & "%" 
Next t 
End Sub 
+0

謝謝,我會嘗試了這一點。 – wmasliuk 2014-09-05 16:45:55