Profil de TrebEvil Doctor PorkChopPhotosBlogListes Outils Aide
6 octobre

Rolling up current Project Phase info in Project Server

This post is a starter to enable you to rollup phase level information within a project to the project level.  This enables you to view the information via PWA and to export it to Excel. 
 
This technique assumes you can represent your phase with Milestones.  (Feasibility Phase milestone, etc.) Current phase is denoted by the in process milestone (first not completed milestone)  In order to use this data in PWA, you have to put it in the Project Summary task. 
 
Even though the summary task is a task, is has a one to one relationship with the project record and contains all of the task related information.  PWA Project Center can display information from the Project Summary task so it makes a good location for rollup task information.The Project Summary task has a task number of 0 and is not normally visible.  To view the project summary task, go to Tools, Options and then click the View tab.  Then check the box to Show Project Summary Task.

Numeric custom fields will roll up to the Project Summary task if you set them to do so.  However, the same is not true for text fields.  In order to have that data live in the Project Summary, you have to perform a bit of macro code. 
 
Please note, this was created for a linear process.  If you have the potential for multiple active milestones, the macro in it's current form will rollup the last one found.  It can easily be modified to accomodate your particular business needs.
 
The solution uses three custom fields.  The custom fields are used as follows. 
 
Since you probably don't want to evaluate every milestone in your plan, you will need to designate the milestones to evaluate.  We will use a flag field to denote which milestones are to be evaluated.  A good practice would be to create a project template with your standard milestones already present and marked accordingly. 
 
The second custom field will contain the finish date of the current phase milestone.  The flag above will be used in a formula for this field.  The Current phase is denoted as a milestone which is flagged for evaluation, has a finish date greater than today and is not marked complete.
 
The third custom field stores the task name for the current phase.  This is rolled up to the Project Summary Task so that it can be used in PWA.
 
SETUP
  1. Create your project plan template containing your standard milestones.
  2. Customize Flag1 to denote which milestones you want to evaluate.  You can rename the field to be more apparent as to it's purpose if you like.  The formulas below will use the original name. 
  3. Customize Date2 to use the following formula.  This formula puts the finish date of the current phase milestone into this field.  Make sure you set the rollup the Maximum value or you won't get the correct value at the Project Summary task level.
    IIf([Flag1]=Yes And [Finish]>DateValue([Current Date]) And [% Complete]<>100
    And [% Complete]>0,ProjDateValue([Finish]),ProjDateValue('NA'))
  4. Customize Text 1 with the following formula.  This retrieves the name description of the current phase milestone.
    IIf(ProjDateValue([Date2])<>ProjDateValue('NA') And [Summary]=No,[Name],"") 
  5. Temporarily add Flag1 to your view.
  6. Mark the milestones in your Project Plan to evaluate by setting the value of Flag1.
  7. Since a macro is used, macro security must be set to either Medium or Low for execution to occur.  I recommend Medium since that provides the user with a measure of control when opening unfamilar project plans.  To set the macro security, in Project Pro, go to Tools, Macro, Macro Security and set the value appropriately.  You may also want to restart Project as a prudent measure.
  8. Lastly, add the following macro code to move the Text 1 value to the Project Summary rollup.  To do this, press Alt+F11. The macro code needs to be added in the "ThisProject" entry under VBAProject([name of open project]), Microsoft Project Objects should be selected in the left pane.  Select it if it is not already open.  Paste in the code below.

    Private Sub Project_BeforeSave(ByVal pj As MSProject.Project)

    Dim t As Task
    On Error GoTo ErrorHandler

    Application.CalculateAll

    For Each t In ActiveProject.Tasks
        If t.Text1 <> "" Then
            SetTaskField Field:="Text1", Value:=t.Text1, TaskID:="0"
        End If
    Next t

    GoTo EndSub

    ErrorHandler:

        MsgBox Prompt:="Error Number: " & Err.Number, Buttons:=vbCritical, _
        Title:="Set of Milestone To Summary Level Macro Error"
       
    EndSub:
    End Sub
  9. Save the project. 
  10. If you autopublish, the values will get published to PWA automatically.  Otherwise, you have to remember to publish.
  11. Go to PWA and create a Project Center view that has the Date1 and Text1 in it.  You can select the names that you renamed the fields to, but you have to make sure that all of the projects in the view have the same field rename.  Otherwise, you may get some strange results.
  12. If you did everything above, you should see your desired data.

 

Enjoy!

Commentaires (1)

Veuillez patienter...
Le commentaire entré est trop long. Raccourcissez-le.
Vous n'avez rien entré. Réessayez.
Il est actuellement impossible d'ajouter votre commentaire. Réessayez plus tard.
Pour ajouter un commentaire, tu dois avoir l'autorisation de tes parents. Demander l'autorisation
Tes parents ont désactivé les commentaires.
Il est actuellement impossible de supprimer votre commentaire. Réessayez plus tard.
Vous avez dépassé le nombre maximal de commentaires qu'il est possible d'envoyer le même jour. Réessayez dans 24 heures.
Votre compte a pu laisser les commentaires désactivés parce que nos systèmes indiquent que vous risquez d'arroser d'autres utilisateurs de messages. Si vous pensez que votre compte a été désactivé par erreur, contactez l'assistance en ligne de Windows Live.
Effectuez la vérification de sécurité ci-dessous pour finaliser l'envoi de votre commentaire.
Les caractères entrés pour la vérification de sécurité doivent correspondre à ceux de l'image ou du fichier audio.
Treb Gatte a désactivé les commentaires dans cette page.
18 Mar.