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)
Dropping columns from a table in BIRT report
kumaresh
Hi
I have to drop / hide columns from the table in the report i have developed depending upon the selections made by the user through report parameters. How can all this be done?
I mean is it possible by giving a list option in report parameters ? Or hiding the column through Visibility option depending on the parameter?
Or is there more ways to do this?
Thank you!
Find more posts tagged with
Comments
JasonW
You could use visibilty expression or you could use script to drop a set of columns. Take a look at this example to see how to drop them:
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1408-drop-columns-dynamically-using-de-api-in-script/
Jason
kumaresh
Hi Jason
Thnks for the report.
In the example you have given, we have it like, whichever option we select while running the report, those columns are dropped.
What should we do if the requirement is to have the columns that are selected and drop those that are unselected? This requirement is like a reverse of the job what the example you gave does.
Anand.
JasonW
Take a look at the revised example.
Jason
kumaresh
Hi
Thanks for your reply.
The beforeFactory script was same as what i was expecting. Thanks a lot for your help.
I need your help in one more issue now.
I have to introduce 2 blank rows in the Excel version of the report depending upon the condition.
It is like, when 'x' is a column in a table with values only 1 and 2, and the table is sorted in ascending order.
Once rows having 1 is displayed, two empty rows has to be given and 2 should be displayed after that.
I have attached a picture to explain it better.
Can this be done in BIRT?
JasonW
Yes this can be done. You have to add two additional detail rows to the table and then hide them for all output formats but xls using a visibility expression. In the xls visibility expression you have to make the decision on whether to hide them based on values. In the attached example I did it this way:
if( row["Column Binding"] == 1 && row["ORDERLINENUMBER"] != 1 ){
false;
}else{
true
}
The column binding field just stores the last column value. Look at the scripts on the table and the third detail row.
Jason