Retrieving multiple custom attributes in BIRT report
I'm trying to put together some reports using BIRT, RTC 3.0.1, and the Jazz Datasource and have run into a problem with multiple custom string attributes. I have been able to retrieve one custom attribute using the STRING_KEY/STRING_VAL columns and the ENUMERATIONS table. What is the best practice for handling multiple columns; should I use a nested report for each custom attribute? I can think of a few ways to do this using a straight JDBC datasource. Is there a pretty/efficient way to do this?
Thanks,
-Ben
One answer
There could be many ways to do this:
You could create a data set for each key value. So if you are fetching custom attributes att1 and att2, you end up with two data sets where you pass the hard coded value att1 as a parameter to data set 1 and the hard coded value att2 to data set 2. If you only have two custom attributes, you could use a joint BIRT data set to join the two. If you have many more, it is better to store all the data from the various data sets into one javascript data structure and then expose it using a BIRT scripted data set.
You could also fetch the key value pairs in one data set. Store the contents of the data set in a javascript data structure, then expose it to BIRT using a scripted data set that makes the custom attributes look like real columns.
Here is an example:
(work item 1, att1, val1)
(work item 2, att1, val2)
(work item 1, att2, val3)
The java script data structure to expose the above will be an array containing two objects:
[ {id: work item 1, att1: val1, att2: val3}, {id: work item 2, att1: val2, att2: null} ]
A BIRT scripted data set can easily expose the above data structure as a table with three columns.
A third way to do the above is to fetch the custom attributes individually for each work item by dynamically passing the work item id and the custom attribute key to a data set for each work item.
Comments
Satoshi Tanaka
Jun 21 '13, 3:16 a.m.I'm also trying do the same thing. Is there anyone who can advise us? Thank you.
Vinay Kumar AV
Jun 21 '13, 3:17 a.m.Any answers for this?
sisi zhang
Jun 21 '13, 3:17 a.m.I also want to know this
Krzysztof Kaźmierczyk
Jun 21 '13, 3:18 a.m.I also would like to know the answer.