Merlin – Do a bit of magic in reports – Part VII

Those of you who have checked our new post series about “Merlin report templates” know by now…

Now let’s do some magic with the reports.


What if you want to report the project’s name in the Next Due Activities report?

Merlin delivers a template for “Next Due Activities” report which is based in XSLT. When editing this report template in order to get the value of the “project” for a task, you will see that it is not very easy to browse up the related xml node and locate the name of the parent project. To work around this issue, we simply modified the “classic report” python report to output the desired information.  You may download  it from here. An output sample:

And the report options:

Installation:

  • Extract the zip first
  • place the contained mrept package under the following path of your mac: ~/Library/Application Support/Merlin/Reports
  • (in case you have no “Reports” folder please create it first and pay attention to name it exactly as “Reports”)
  • restart your Merlin and
  • call File > New Report… to find the new report called “Next Due Activities (with project information)”.

9 thoughts on “Merlin – Do a bit of magic in reports – Part VII

  1. This is a great report, but for me is missing the ability to filter by resource. I want to choose the resource and see the work they’ve got coming up!

    I will attempt to modify this in the report, according to your instructions, but have found this tricky in the past!

  2. Hi Tom,

    you can add the following dict in the options:
    info.plist

    		
    			key
    			selectedResource
    			possibleValuesKeyPath
    			project.sortedMasterResources.title
    			restrictToPossibleValues
    			
    			title
    			For Resource
    			valueClass
    			NSString
    		
    

    insert the following initial value in the class MERNextDueActivities(PWReportPage) of the main python script:

    self.selectedResource = “”

    and modify the upcomingActivities, overdueActivities, and deadlineActivities methods as follows to check for the selected resource:

    	def upcomingActivities(self):	
    		result = []
    		minStart = NSDate.systemNowInGMT()
    		maxStart = self.duration.dateFloatedFromDate_(minStart)
    		resource = self.selectedResource
    		
    		for activity in self.project.visibleSimpleActivities():
    			start = activity.expectedStartDate()
    			assignedResources = activity.assignedResourcesString()
    			if resource != None: 
    				isResourceInActivity = (assignedResources != None) and resource in assignedResources
    			else:
    				isResourceInActivity = True
    			if (not activity.isPrivate()) and (not activity.isMilestone()) and start>=minStart and start<=maxStart and (not activity.isComplete()) and isResourceInActivity:
    				result.append(activity)
    		return NSArray.arrayWithArray_(result).sortedArrayUsingDescriptors_(self.upcomingActivitiesSortDescriptors)
    		
    	def overdueActivities(self):
    		result = []
    		now = NSDate.systemNowInGMT()
    		resource = self.selectedResource
    
    		for activity in self.project.visibleSimpleActivities():
    			start = activity.expectedStartDate()
    			end = activity.expectedEndDate()
    			assignedResources = activity.assignedResourcesString()
    			if resource != None: 
    				isResourceInActivity = (assignedResources != None) and resource in assignedResources
    			else:
    				isResourceInActivity = True			
    			if (not activity.isPrivate()) and ((now>=end and (not activity.isComplete())) or (now>=start and activity.actualCompletion()==0)) and isResourceInActivity:
    				result.append(activity)
    		return NSArray.arrayWithArray_(result).sortedArrayUsingDescriptors_(self.overdueActivitiesSortDescriptors)
    
    	def deadlineActivities(self):
    		result = []
    		minEnd = NSDate.systemNowInGMT()
    		maxEnd = self.duration.dateFloatedFromDate_(minEnd)
    		resource = self.selectedResource
    
    		for activity in self.project.visibleSimpleActivities():
    			end = activity.expectedEndDate()
    			assignedResources = activity.assignedResourcesString()
    			if resource != None: 
    				isResourceInActivity = (assignedResources != None) and resource in assignedResources
    			else:
    				isResourceInActivity = True
    			if (not activity.isPrivate()) and end>=minEnd and end<=maxEnd and (not activity.isComplete()) and isResourceInActivity:
    				result.append(activity)
    		return NSArray.arrayWithArray_(result).sortedArrayUsingDescriptors_(self.deadlineActivitiesSortDescriptors)
    
    

    Best regards, Vicky

  3. Pingback: Merlin – Do a bit of magic in reports – PART XX » MacPM

  4. Pingback: MERLIN – DO A BIT OF MAGIC IN REPORTS – PART XVIII » MacPM

  5. Pingback: Merlin – Do a bit of magic in reports – PART XXII » MacPM

  6. Pingback: Merlin – Do a bit of magic in Merlin reports – PART XXII » MacPM

  7. Vicky,

    How do I modify the columns that are printed in the subsequent report? I’d like to replace the # column with WBS Code. I’d also like to replace “Resource” with a custom field called “Task Manager”. I’m not seeing a way to do this as that level of granularity appears to be obfuscated. Can I do these things with this report?

    Thanks!

    Raymond

  8. Pingback: Merlin – Do a little bit of magic in Merlin reports – part XXIV | MacPM

  9. Pingback: Merlin – Do a bit of magic in Merlin reports – PART XXI | MacPM

Comments are closed.