Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Birt Report column hiding
prashu_444
hi,
is it possible to hide a column of birt report at runtime ?? how to achive it ???????????
Find more posts tagged with
Comments
mwilliams
Hi prashu_444,
On what condition would you want to hide the column? You can write an expression for the hide to hide based off of a parameter value.
prashu_444
hi Michael,
Thanks for ur replay.
I have 10 columns in my reports . Based on user input I want hide columns.
I want to generate report based on report parameters from year , to year.
if user selects 5 years(with from date and to date reange) only 5 columns should be displayed.
This is my problem. I am new to birt. Can u please tell me how i can write expression to hide the column.
Thanks
Prashanth.J
mwilliams
Prashanth.J,
So, you have 10 years worth of data, but the user has the ability to select a range of years that could be less than 10....something like the following:
Design:
1998 1999 2000 2001 2002 2003 2004 2005 2006 2007
Dtl1 Dtl1 Dtl1 Dtl1 Dtl1 Dtl1 Dtl1 Dtl1 Dtl1 Dtl1
Dtl2 Dtl2 Dtl2 Dtl2 Dtl2 Dtl2 Dtl2 Dtl2 Dtl2 Dtl2
User Input Parameters:
Start Date = 2003
End Date = 2005
Final Report:
2003 2004 2005
Dtl1 Dtl1 Dtl1
Dtl2 Dtl2 Dtl2
Am I understanding correctly? Let me know.
prashu_444
thanks Michael.
this is exactly what I am looking for .
Can u please provide the solution for this problem ☺
mwilliams
Prashanth.J,
What version of BIRT are you using, so I can make an example in the correct version? Thanks.
prashu_444
hi Michael ,
I am using Eclipse BIRT Designer Version 2.2.1.r22a_v20071101 Build <2.2.1.v20071101-1439>.
Thanks
Prashanth.J
mwilliams
Prashanth.J,
I don't have 2.2.1, but I have 2.2.2. I'll make an example in there and post it in here. You'll have to open it in 2.2.1 and change the version information in the XML source to match your version information, then you should be able to run it.
mwilliams
Prashanth.J,
Actually, before I make an example, I have a couple questions.
Are you using a crosstab or just a table?
Also, what does the data in your dataset look like? Thanks.
prashu_444
hi Michael ,
Its for table.The data in the table is of varchar2 type
Thanks and Regards
Prashanth.J
mwilliams
Prashanth.J,
Sorry, I probably didn't ask the right question. What I meant by what does your data look like, I meant how is it set up? Are there columns for every year with details below that like:
2006 2007 2008 2009
dtl1 dtl1 dtl1 dtl1
dtl2 dtl2 dtl2 dtl2
etc...
or is it like this in the dataset:
year dtl1 dtl2 dtl3...etc
2006 blah blah blah
2007 blah blah blah
Let me know.
Thanks
mwilliams
Prashanth.J,
I guess regardless of how your data is set up in your dataSet, if you've already got it looking like I said before in your table and you know the 10 years that you're showing. All you would have to do is select each column, go to the visibility tab in the property editor and use an expression like:
if (param["firstYear"] <= columnYear && columnYear <= param["lastYear"]){
false
}
else{
true
}
I haven't tested it, but since you know the 10 years and the user is just selecting the range, this should work just fine.
hgk
The suggestion did not work for me in Birt 2.2.1.
I created a boolean parameter and used it in expression.
So just
param[ReportColumnVisible]
for expression. I set the value of ReportColumnVisible in my java code.