Merlin – Adding an option in a report template

Report template options are saved in the /Contents/info.plist within a Merlin‘s report template package and shown in the order they are defined. Therefor, should you want to add another option for your custom report:

  • You open the info.plist as found in your report template package under /Contents
  • Check the dictionaries defined for the key PWReportParameters
  • And define your own dict in the position you would like it to be shown

Note: Use existing options as reference on how to define checkboxes, lists, or text entry fields

Some examples:

1. You have created a copy of the existing Next Due Activities report (as explained here) and want to add an option to disable the “Group” column in the outputted table.

Your workflow

  • Open the info.plist as found in your report template package under /Contents
  • Copy the dict definition for another checkbox option (for example this for withProjectImage)
  • And paste
  • Edit the strings for key and title in the pasted dict.

<dict>
<key>key</key>
<string>withGroup</string>
<key>title</key>
<string>Group</string>
<key>valueClass</key>
<string>NSNumber</string>
<key>style</key>
<string>bool</string>
<key>defaultValueString</key>
<string>0</string>
</dict>


Note: A defaultValueString of 1 means that this option is on per default. You may enter a 0 if you want this option to be off.

  • Save your changes
  • Open the Report.xslt from your lproj folder (for this post, we assume you are editing Report.xslt out of /Contents/Resources/English.lproj)
  • Locate on the start of the Report.xslt the rows defining the parameter names. You can search for
    param name="withProjectImage"
  • Copy this line and paste
  • Enter withGroup instead of  the pasted withProjectImage:

<xsl:param name=”withGroup”/>

  • Locate the row outputting the Group title in the table, it is
    <th>Group</th>
  • Do a test for the value of $withGroup by 1 and allow it to be shown only then
    <xsl:if test="$withGroup = 1"><th>Group</th></xsl:if>

  • Locate the row outputting the Group’s value in the table, it is
    <td width="18%"><xsl:value-of select="../title"/></td>
  • Do a test for the value of $withGroup by 1 and allow it to be shown only then.
<xsl:if test="$withGroup = 1">
<td width="18%"><xsl:value-of select="../title"/></td>
</xsl:if>

Note: There are 2 rows to change. Once the table outputting when <xsl:if test=”$showResource = ” “> and a second time for <xsl:if test=”$showResource != ” “>

  • Save your Report.xslt file
  • Restart Merlin if it is already running
  • Open your project
  • Call File > New Report…  and select your thus changed report
  • It won’t show the “Group” column per default, but you can enable its display in the options:

2. You have created a copy of the existing Cost Distribution report (as explained here) and want to add an option to disable the “Group” column in the outputted table.

See next blog post for the workflow

______

Related Posts:

32 thoughts on “Merlin – Adding an option in a report template

  1. Pingback: Merlin – Localize a Merlin report template » MacPM

  2. Pingback: Merlin – Adding an option in a python/wbl report template » MacPM

  3. Pingback: Merlin – adding a property into an existing report » MacPM

  4. Pingback: Merlin – Adding a property into an existing python template » MacPM

  5. Pingback: Merlin – do a bit of magic in reports » MacPM

  6. Pingback: Merlin – do a bit of magic in reports – part III » MacPM

  7. Pingback: MERLIN – DO A BIT OF MAGIC IN REPORTS – PART VI » MacPM

  8. Pingback: Merlin – Do a bit of magic in reports – Part VIII » MacPM

  9. Pingback: Merlin – Do a bit of magic in reports – Part IX » MacPM

  10. Hello Gentlemen, does anybody know about a merlin report builder interface with no manually editing xml file. Any plan for merlin 3 about it ? really missing it

    Thanks a lot

    Ed

  11. Thanks for your comment Ed.

    Current reports concept of Merlin is indeed not that comfortable and rather technical when it comes to customizing. It will certainly be better and easier in the next major update. An ETA is however at this time point not available.
    Best regards, Vicky

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

  13. Pingback: Merlin – Do a bit of magic in reports – PART XIIX » MacPM

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

  15. Pingback: Merlin – Do a bit of magic in reports – PART XXI » MacPM

  16. Pingback: Merlin – Do a bit of Magic in Reports – Part XV » MacPM

  17. Pingback: MERLIN – DO A BIT OF MAGIC IN REPORTS – PART XII » MacPM

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

  19. Pingback: Merlin – Do a bit of magic in Merlin reports – PART XXIII » MacPM

  20. I do accept as true with all the ideas you have offered on your post. They are really convincing and can definitely work. Nonetheless, the posts are very brief for starters. May just you please lengthen them a little from next time? Thanks for the post.

  21. Pingback: Merlin - Do a little bit of magic in Merlin reports - part XXIV » MacPM

  22. Pingback: Merlin – Do a little bit of magic in Merlin reports – part XXVI » MacPM

  23. Pingback: Merlin – Do a little bit of magic in Merlin reports – part XXVII »

  24. Pingback: Merlin – Localize a Merlin report template »

  25. Pingback: MERLIN – DO A BIT OF MAGIC IN REPORTS – PART XI »

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

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

  28. Pingback: Merlin – Do a bit of Magic in Reports – Part X | MacPM

  29. Pingback: Merlin – Do a bit of magic in reports – Part IX | MacPM

  30. Pingback: MERLIN – DO A BIT OF MAGIC IN REPORTS – PART VI | MacPM

  31. Pingback: Merlin – Do a bit of magic in reports – Part V | MacPM

  32. Pingback: Merlin – Do a bit of magic in Merlin reports – PART XX | MacPM

Comments are closed.