Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Dynamic dataset in birt
Haris
hi,
can somebody help me on the below issue
i am sending dynamic table column name from my java web application(through frame set as report parameter) and i want to create a data set with that column name that i have passed.whether this can be achieved in birt?
example:
i have the country table with column name
COUNTRY_I_D
COUNTRY_CODE
COUNTRY_NAME
UNIT_FK
In my web application user can select the multiple column name for the country table(for example if he choose
COUNTRY_CODE,COUNTRY_NAME).i am passing it to birt via report parameter like this
"frameset?__report=country.rptdesign"+"&columnName=COUNTRY_CODE,COUNTRY_NAME"
and in birt i want a dataset like this
select COUNTRY_NAME,COUNTRY_CODE from country
output:
GERMANY DE
UNITED KINGDOM UK
INDIA IN
POLAND PL
UNITED STATES OF AMERICA US
i am new to birt and can somebody help me
Find more posts tagged with
Comments
johnw
You can do a dynamic data set like this, but you would need a dynamic table to go with it to create the binding, and your setting yourself up for more work then you really need.
The easier approach would be to have all the columns in your table in the query, and using visibility expressions, only show the columns that the user selects.
So, you would have a data set like:
select column1, column2, column3, column4 from table;
You would create your table like normal, then for each column in the table, you would use a visibility expression like:
//if the column has been selected and is passed in the parameters, return false, meanin
//that the visibility expression will have a false value, forcing it to show.
//visibility expressions only hide if the value is true.
//replace X below with the column number
if (params["columns"].value.contains("columnX"))
{
(false);
}
else
{
(true);
}
There should be an example in the DevShare already on how to do this. If not, I can throw together an example if I don't already have one someplace.
John
Haris
Thanks for giving me a solution...i have achieved the result by the way you have suggested..