It's all about the answers!

Ask a question

Retrieving multiple custom attributes in BIRT report


Benjamin DeVore (1633) | asked Sep 19 '11, 2:20 p.m.
retagged Jun 17 '13, 3:13 p.m. by Krzysztof Kaźmierczyk (7.4k375103)
Hello,
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

Comments
Satoshi Tanaka commented Jun 23 '12, 10:55 p.m. | edited 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 commented Sep 06 '12, 4:51 p.m. | edited Jun 21 '13, 3:17 a.m.

Any answers for this?


sisi zhang commented Apr 17 '13, 3:27 a.m. | edited Jun 21 '13, 3:17 a.m.

I also want to know this


Krzysztof Kaźmierczyk commented Jun 17 '13, 3:13 p.m. | edited Jun 21 '13, 3:18 a.m.

I also would like to know the answer.

One answer



permanent link
Rafik Jaouani (5.0k16) | answered Jun 17 '13, 5:21 p.m.
JAZZ DEVELOPER

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
Krzysztof Kaźmierczyk commented Jun 18 '13, 2:36 a.m.

It does not seem to be trivial. Anyway thank you Rafik for the answer!

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.