Those of you who have checked our new post series about “Merlin report templates” know by now…
- How to modify existing reports
- How to edit description or report template names
- How to create your own report templates
- How to localize a Merlin report template
- Further tips for localizing an xslt report template
- How to add an option in an xslt report template
- How to add an option in a python / wbl report template
- How to add a property into an existing xslt report
- How to add a property into an existing python /wbl report template
Now let’s do some magic with the reports.
- What if you want to map a status or flag information to a graphic file?
- What if you want to be able to define the size of the project image over the options?
- What if you want to list overdue tasks along with the next activities, in “Next Due Activities” report?
What if you want to list overdue tasks along with the next activities, in “Next Due Activities” report?
The ‘Next Due Activities’ report lists not yet completed activities ending today or within the time period defined in the report’s options. This is done by a ‘select’ in the Report.xslt file:
<xsl:for-each select="(//Activity | //Project) [not(Activity) and xs:dateTime(expectedEndDate) <= xs:dateTime($maxDate) and xs:dateTime(expectedEndDate) >= $now and actualCompletion < 1.0]">
If you would like to list over due tasks as well you would need to modify the select not to check if the expected End Date is greater than the current time point… thus:
<xsl:for-each select="(//Activity | //Project) [./Assignment/title=$showResource and xs:dateTime(expectedEndDate) <= xs:dateTime($maxDate) and actualCompletion < 1.0]">
Note: In this report template you will find 2 selects. Once for reporting for all resources, and a second time for reporting tasks of the selected resource. Make sure you change them both.
Also if preparing this report  for someone else which may use it in German, remember to change the selects in the Report.xslt underneath the German.lproj as well.
Surely you can create an option for your report, so you as user could decide whether or not to include overdue activities in the outputted report. This is fine, you know by now how to do this, just put your special selects in your own conditional if blocks. For example:
<xsl:if test="$withOverdues = 1"> <xsl:for-each select="(//Activity | //Project) [not(Activity) and xs:dateTime(expectedEndDate) <= xs:dateTime($maxDate) and actualCompletion < 1.0]">
Downloadables: You will find a copy of this report template in a related thread in the Merlin user forum as an attachment for you to download
___
UPDATE [Sept 8, 2011]: The standard template was not outputing long activities having an expected end past beyond the duration defined in the options. To solve this the select row should also contain a check for expectedStartDate. So when checking the tasks without overdues the select row should be changed thus:
<xsl:for-each select="(//Activity | //Project) [not(Activity) and ((xs:dateTime(expectedStartDate) >=$now and xs:dateTime(expectedEndDate) <= xs:dateTime($maxDate)) or  (xs:dateTime(expectedStartDate) >= $now and xs:dateTime(expectedStartDate) <= xs:dateTime($maxDate))) and actualCompletion < 1.0 ]">
And when testing for the overdues just select…
<xsl:for-each select="(//Activity | //Project) [not(Activity) and xs:dateTime(expectedStartDate) <= xs:dateTime($maxDate) and actualCompletion < 1.0 ]">
Downloadables: You may download this new version of the template from here having all selects correctly when reporting for all resources, just for a specified, in German or in English.
Pingback: MERLIN – DO A BIT OF MAGIC IN REPORTS – PART VI » MacPM
Pingback: MERLIN – DO A BIT OF MAGIC IN REPORTS – PART VII » MacPM
Pingback: Merlin – Do a bit of magic in reports – Part VIII » MacPM
Pingback: Merlin – Do a bit of magic in reports – Part IX » MacPM
Pingback: Merlin – Do a bit of magic in reports – PART XIIX » MacPM
Pingback: Merlin – Do a bit of magic in reports – PART XX » MacPM
Pingback: Merlin – Do a bit of magic in reports – PART XXI » MacPM
Pingback: MERLIN – DO A BIT OF MAGIC IN REPORTS – PART XII » MacPM
Pingback: Merlin – Do a bit of magic in reports – PART XXII » MacPM
Pingback: Merlin – Do a bit of magic in Merlin reports – PART XXII » MacPM
Pingback: Merlin – Do a bit of magic in Merlin reports – PART XXIII » MacPM
Pingback: Merlin - Do a little bit of magic in Merlin reports - part XXIV » MacPM
Pingback: Merlin – Do a little bit of magic in Merlin reports – part XXVI » MacPM
Pingback: Merlin – Do a little bit of magic in Merlin reports – part XXIV »
Pingback: Merlin – Do a bit of magic in reports – Part V | MacPM