We have explained how to add options in your Merlin report templates and control the content of the outputted data. In our examples we define an option to be able to disable a known property,  but how to proceed if you want to add the values of a property in your report and don’t know its actual name? This post will try to give some tips on this. For reasons of simplicity we differentiate between XSTL report templates, and templates based on  python / wbl:
1. Insert a property into an existing XSLT report template.
2. Insert a property into an existing python / wbl report template
1. Insert a property into an existing XSLT report
Let’s suppose, you have a copy of the existing “Next Due Activities” report (as explained here) and want to add an option to enable the “Notes†column in the outputted table.
Your workflow
- You add a new option with the name withNotes as explained here in the info.plist
- Edit the Report.xslt in your language folder and define
param name="withNotes"
- You enter in the table header area the display of the “Notes” header depending on the value of the $withNotes:
<xsl:if test="$withNotes = 1"><th>Notes</th></xsl:if>
You will see it within the following tags and placed in an <Activity> dictionary:
<description>hello</description>
So now you know: To get the Notes value you need to ask the value of description when iterating the activities.
- So you insert the following in the two table iterations
<xsl:if test="$withNotes = 1"> <td width="18%"><xsl:value-of select="description"/></td> </xsl:if>
- Save your Report.xslt
- And refresh the report in the Report window.
Note: When asking the properties of the current iteration you ask directly its properties (tags). If you need to ask a property of a dictionary in a higher level, for example of the group containing the task, you ask ../description. If you need to ask the contents of a deeper element of the current task, you can call ./description
2. Insert a property into an existing python / wbl report template
Let’s suppose you  have created a copy of the existing Classic Report (similar to what we have explained here) which is a python/wbl report template and want to add an option to enable the display of some additional columns in the outputted table.
See next post
______
Related Posts:
- Modifying existing reports
- Edit description or report template names
- Creating your own report templates
- Localize a Merlin report template
- Further tips for localizing an XSLT report template
- Adding an option in a report template – example for xslt report
- Adding an option in a python / wbl report template
Pingback: Merlin – Adding an option in a python/wbl report template » MacPM
Pingback: Merlin – Adding a property into an existing python template » MacPM
Pingback: Merlin – do a bit of magic in reports » MacPM
Pingback: Merlin – do a bit of magic in reports – part II » MacPM
Pingback: Merlin – do a bit of magic in reports – part III » MacPM
Pingback: MERLIN – DO A BIT OF MAGIC IN REPORTS – PART VII » MacPM
Pingback: Merlin – Do a bit of magic in reports – Part IX » MacPM
Pingback: Merlin – Do a bit of magic in reports – Part V » MacPM
Pingback: MERLIN – DO A BIT OF MAGIC IN REPORTS – PART XVIII » MacPM
Pingback: Merlin – Do a bit of Magic in Reports – Part XV » 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 little bit of magic in Merlin reports - part XXV » MacPM
Pingback: MERLIN – DO A BIT OF MAGIC IN REPORTS – PART XI | MacPM
Pingback: Merlin – Do a little bit of magic in Merlin reports – part XXVI | MacPM
Pingback: Merlin – Do a bit of magic in Merlin reports – PART XXIII | MacPM
Pingback: Merlin – Do a bit of magic in Merlin reports – PART XXII | MacPM
Pingback: Merlin – Adding a property into an existing python template | MacPM