www.projectwizards.net/

Merlin – Adding an option in a report template

on 1. August 2011

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:

Tags: ,

Written by Vicky Stamatopoulou
Vicky Stamatopoulou works at ProjectWizards. She contributes to the MacPM.net blog, Merlin user forums, or other web spaces of ProjectWizards. The content provided is about Merlin or Mac usage, documentation, AppleScripting, or customization. Google+

18 Comments »

  1. Pingback by Merlin – Localize a Merlin report template » MacPM (August 1, 2011 @ 8:26 pm

    [...] See one of next blog posts [...]

  2. Pingback by Merlin – Adding an option in a python/wbl report template » MacPM (August 2, 2011 @ 1:12 pm

    [...] Proceed as explained here [...]

  3. Pingback by Merlin – adding a property into an existing report » MacPM (August 3, 2011 @ 9:08 pm

    [...] add a new option with the name withNotes as explained here in [...]

  4. Pingback by Merlin – Adding a property into an existing python template » MacPM (August 5, 2011 @ 7:59 pm

    [...] Adding an option in a report template – example for xslt report [...]

  5. Pingback by Merlin – do a bit of magic in reports » MacPM (August 8, 2011 @ 10:40 pm

    [...] How to add  an option in an xslt report template [...]

  6. Pingback by Merlin – do a bit of magic in reports – part III » MacPM (September 2, 2011 @ 1:27 pm

    [...] How to add  an option in an xslt report template [...]

  7. Pingback by MERLIN – DO A BIT OF MAGIC IN REPORTS – PART VI » MacPM (October 18, 2011 @ 10:32 am

    [...] How to add  an option in an xslt report template [...]

  8. Pingback by Merlin – Do a bit of magic in reports – Part VIII » MacPM (December 7, 2011 @ 12:52 pm

    [...] How to add  an option in an xslt report template [...]

  9. Pingback by Merlin – Do a bit of magic in reports – Part IX » MacPM (March 5, 2012 @ 9:18 pm

    [...] How to add  an option in an xslt report template [...]

  10. Comment by Ed (January 20, 2013 @ 7:25 am

    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. Comment by Vicky Stamatopoulou (January 21, 2013 @ 1:26 pm

    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 by MERLIN – DO A BIT OF MAGIC IN REPORTS – PART XVIII » MacPM (March 12, 2013 @ 2:00 pm

    [...] How to add  an option in an xslt report template [...]

  13. Pingback by Merlin – Do a bit of magic in reports – PART XIIX » MacPM (March 15, 2013 @ 10:29 pm

    [...] How to add  an option in an xslt report template [...]

  14. Pingback by Merlin – Do a bit of magic in reports – PART XX » MacPM (March 21, 2013 @ 4:13 pm

    [...] How to add  an option in an xslt report template [...]

  15. Pingback by Merlin – Do a bit of magic in reports – PART XXI » MacPM (April 8, 2013 @ 8:54 pm

    [...] How to add  an option in an xslt report template [...]

  16. Pingback by Merlin – Do a bit of Magic in Reports – Part XV » MacPM (April 8, 2013 @ 9:02 pm

    [...] How to add  an option in an xslt report template [...]

  17. Pingback by MERLIN – DO A BIT OF MAGIC IN REPORTS – PART XII » MacPM (April 12, 2013 @ 12:07 pm

    [...] How to add  an option in an xslt report template [...]

  18. Pingback by Merlin – Do a bit of magic in Merlin reports – PART XXII » MacPM (May 3, 2013 @ 2:22 pm

    [...] How to add  an option in an xslt report template [...]

RSS feed for comments on this post. TrackBack URL

Leave a comment