It's all about the answers!

Ask a question

How to graph enumeration lists in BIRT?


Ian Wark (6802540) | asked Jul 31 '14, 12:27 a.m.
We are trying to use enumeration list values in BIRT bar charts.

We noticed a virtually identical question here, but although the poster found a solution, it was only partially documented.

https://jazz.net/forum/questions/115288/how-to-create-a-birt-report-with-enumeration-list

Enumeration lists allow multiple selections. On the BIRT side the data is held in a MEDIUM_STRING_VAL as a concatenated string.

For example:
component.literal.l2|component.literal.l17|component.literal.l18|component.literal.l19|...

When you have multiple values for a field and use a BIRT bar chart to display it, how do you do it? We would like the enumeration list field on the x axis and the work item count on the y axis.

We tried putting the enumeration list values on the x axis, but the whole string is treated as a single value and plotted against the work item count. What we want is a chart which lists the sum of work items for
"component.literal.l2", the sum of work items for "component.literal.l17" etc..

Is there a way do this in BIRT?

One answer



permanent link
Yusuke Kobayashi (31164) | answered Jul 31 '14, 4:34 a.m.
Hi, Wark-san.

I think it is necessary to split the concatenated string value, so Javascript coding is required.

To split, 'onFetch' event may be available.
It is one of the Dataset events, and fired after fetching each row.
In this event, you should split the concatenated string value and store the splitted values into Javascript variables.

After that, you must take the values from variables, and set the values into dataset using Scripted Dataset and its events.

The following information may help you.
http://www.eclipse.org/birt/documentation/integrating/scripting.php

Yusuke Kobayashi


Your answer


Register or to post your answer.