Kotagiri just asked in another article how to best put "scripted metrics" in a report and I would like to use the chance to write a bit on that.
First of all there are two different ways:
- The report designer might be the one that aggregates the data and wants to show them in the report so he is the one who creates "Custom Columns" using scripts etc., see the other articles how to do it
- The medini project template may already have scripted the metrics as "Derived Profile Property" so the script is located and evaluated in the project, the report designer just has to "read" it and put it nicely into the report
The main difference between these two ways is as mentioned the objective, but there also a technical one: scripts inside the project are more powerful when it comes to finding and filtering objects and data. Furthermore you can use OCL to develop them, in the BIRT report you just can use Java Script.
So I propose to always try to do it in the project first. Lets see an example.
I have created a metric property that works on "FTA Models":
In my case, it simply outputs the number of events in the tree, you can do whatever you want here:
Note again that this is not in the report design but in the medini project.
So I can see the metrics also when selecting an FTA model:
In the report design I have created an OCL based data set (should work also with native sets). I have added a "computed" column that just accesses he property:
The code is a bit tricky and looks like this:
As snippet:
row["@self"].getObject().getProfilePropertyValue("info_1").get(0);It basically get the row object (the FTA model), reads the custom profile property (which is returned always as a list) and grabs the first entry.
Finally I used the data set to render a table with name and the metrics value.

So, you will find the design attached. The medini project can be easily created I think. Make sure the name of the profile property is correct.
Happy Reporting
Jan