Vicky Stamatopoulou on 2. 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:
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 XSLT report and want to add an option.
Your workflow
Proceed as explained here
2. You have created (as explained here) a copy of the existing Cost Distribution report which is a python/wbl report template and want to add an option to disable the “Base Cost” column in the outputted table.
Your workflow
<dict> <key>key</key> <string>withBaseCosts</string> <key>title</key> <string>Base Costs</string> <key>valueClass</key> <string>NSNumber</string> <key>style</key> <string>bool</string> <key>defaultValueString</key> <string>1</string> </dict>
Note: A defaultValueString of 0 defines it off per default. Should you like to have this column outputted, but to be able to switch it off over the options, just enter here 1.


self.withBaseCosts = 0


<th><wbl:String value="Base Cost" localize=YES /></th>
<wbl:Conditional condition=withBaseCosts>
<th><wbl:String value="Base Cost" localize=YES /></th>
</wbl:Conditional>

Note: The outputted table on the report is not yet correct. That it is because we forgot to put all outputs of basecosts in conditionals.
So:
<td><wbl:String value=iterIntervalBaseCost formatter=project.currencyFormatter/></td>
<td><wbl:String value=project.baseCostDeep formatter=project.currencyFormatter valueWhenEmpty=0/></td>


Adding a property in an existing report
Please see next posts
______
Related Posts:
RSS feed for comments on this post. TrackBack URL
Can I use this technique to add a custom column to a report?
I have a couple custom columns (they are simple text fields) I’ve added to my project file and I’d like to include them in a report format.
Also, is the python/wbl report template a better solution to this or would it be easier to customize the other report format?
I am intending to write in the next post, how to find the names of the properties to use when needing to insert something which is not already mentioned in a template… but custom fields are yet again something different.
I am not expecting you can report custom fields over XSLT report templates. Because this kind of report is based on a Merlin XML file created out of the current project, and custom fields are not exported in Merlin XMLs….
So I would have to do some research on this first for the python reports. Hopefully I can find a way to output them.
Best regards, Vicky
You can output the user defined data over ‘userInfo’
So If having 2 user defined fields: add1 and add2
And want to output them in the overdues as shown in a report based on the classic report…
You add in the iteration area…
<td><wbl:String value=iterItem.title/></td>
<td><wbl:String value=iterItem.parentActivity.title/> </td>
The following two rows…
<td><wbl:String value=iterItem.userInfo.add1/> </td>
<td><wbl:String value=iterItem.userInfo.add2/> </td>
In case there is a way to create the report without “knowing” how those custom fields are really called… I will let you know.
Best regards, Vicky
Thanks Vicky. I appreciate the response.
I’m going to try your suggestion in the next day or so. I’m sure I’ll have other issues that come up.
Believe it or not I’m anxiously awaiting your blog posts in this series. Keep up the good (and useful) work.