It's all about the answers!

Ask a question

Using custom attribute as a parameter in BIRT


Krzysztof Kaźmierczyk (7.4k374103) | asked May 16 '13, 10:54 a.m.
Hello,
I would like to create the report where you can select custom attribute as a parameter. I found the video from Rafik: http://www.youtube.com/watch?v=8q29We9QoHE

I have created dataset called countries
Now my issue is following: the list of the countries is empty. It is possibly because the variable projectArea has not been initialised yet.

Attaching my dataset params.
Any ideas? dataset params

Accepted answer


permanent link
Bill Taylor (1441534) | answered May 21 '13, 8:59 a.m.
You can't use scripting like this in setting up parameters.

The easy approach is to create a simple Jazz data set ("Country") ENUMERATIONS, thus:
  1. Make PROJECT_AREA_ITEMID a parameter defaulted to '{Current Project Area}'
  2. Make ENUMERATION_ID a parameter defaulted to 'Country'
  3. Select columns LITERAL_NAME and LITERAL_ID
  4. Create a parameter based on this data set

In theory, the following should work but ENUMERATIONS seems to need an actual PROJECT_AREA_ITEMID parameter to work

If you want to select Project Area, you will need to do the following:

  1. Create the "Country" data set as above but with PROJECT_AREA_ITEMID as a selected column
  2. Create a data set ("ProjectArea")
  3. Join "Country" and "ProjectArea" using PROJECT_AREA_ITEMID into a new data set ("ProjectAreaCountry")
  4. Create a cascading parameter group based on this data set
  5. Add a parameter using PROJECT_AREA_NAME and PROJECT_AREA_ITEMID
  6. Add another parameter using LITERAL_NAME and LITERAL_ID
Krzysztof Kaźmierczyk selected this answer as the correct answer

Comments
Krzysztof Kaźmierczyk commented May 21 '13, 9:14 a.m.

Hi Bill,
you are awesome! Thanks for your help!

One other answer



permanent link
Bill Taylor (1441534) | answered May 17 '13, 5:46 a.m.
A few thoughts:
  1. Which table(s) is the data set based on and what are the fields?
  2. Is 'Country' the enumeration type name or id?
  3. Where is projectArea defined? - I don't think any initialisation is possible before parameter selection
  4. You could default Project Area to the default project area or you could set up a cascading parameter so that project area and enumeration were linked

Comments
Krzysztof Kaźmierczyk commented May 21 '13, 7:36 a.m.

Hello Bill,
1. I wanted to use ENUMERATIONS table name
2. My custom attribute which I would like to set as parameter is Country which is enumeration filed (enumeration id is 'Country').
3. Here is how I define project area:
It is set as script executed onFetch for table PROJECT_AREA. Here is the script:
projectArea = row["PROJECT_AREA_ITEMID"];
4. How to do that? Could you elaborate it?

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.