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)
To hide column in a table based on the name of the column
Happy_20
Hey
Please see the attached Report.
I am using BIRT 2.6 version.
In that the first table has column name as "unused". This text comes from external property file.
I want to hide the column if the column name is "unused". I tried to work with event handler, but there is no Event adapter for column. In case of visibility expression, i can have access to data and row but not to label.
Can you please guide me how to do it.
Thanks in advance.
Find more posts tagged with
Comments
Happy_20
<blockquote class='ipsBlockquote' data-author="'Happy_20'" data-cid="81491" data-time="1313090007" data-date="11 August 2011 - 12:13 PM"><p>
Hey<br />
<br />
Please see the attached Report.<br />
I am using BIRT 2.6 version.<br />
In that the first table has column name as "unused". This text comes from external property file.<br />
I want to hide the column if the column name is "unused". I tried to work with event handler, but there is no Event adapter for column. In case of visibility expression, i can have access to data and row but not to label.<br />
<br />
Can you please guide me how to do it.<br />
<br />
Also it would be great if there is column event adapter enhancement in BIRT.<br />
<br />
Thanks in advance.<br /></p></blockquote>
mcremer
Hi Happy_20,<br />
<br />
First of please don't quote your self to keep a topic in the top. Its not really nice <a class='bbc_url' href='
http://www.albion.com/netiquette/'>NET
etiquette</a>.<br />
<br />
But back to your question.<br />
<br />
What I understand is that you want to set visabilety rules based on a COLUMN value (correct right?).<br />
<br />
But bc Im not sure could you be a bit more detailed (because just a pdf doesn't tell me a lot just the layout).
Happy_20
<blockquote class='ipsBlockquote' data-author="'mcremer'" data-cid="81538" data-time="1313409124" data-date="15 August 2011 - 04:52 AM"><p>
Hi Happy_20,<br />
<br />
First of please don't quote your self to keep a topic in the top. Its not really nice <a class='bbc_url' href='
http://www.albion.com/netiquette/'>NET
etiquette</a>.<br />
<br />
But back to your question.<br />
<br />
What I understand is that you want to set visabilety rules based on a COLUMN value (correct right?).<br />
<br />
But bc Im not sure could you be a bit more detailed (because just a pdf doesn't tell me a lot just the layout).<br /></p></blockquote>
<br />
Hey mcremer,<br />
<br />
Thanks for taking time to read my post. Just to clarify, I didn't quote purposely. If you see, I added extra line in my second post "Also it would be great if there is column event adapter enhancement in BIRT.". I was trying to edit the 1st post and add this line but unfortunately it came up as second post.<br />
<br />
Coming to my question, based on the name of the column I want to hide/unhide column in the table.<br />
<br />
Thanks
mcremer
<blockquote class='ipsBlockquote' data-author="'Happy_20'" data-cid="81550" data-time="1313420343" data-date="15 August 2011 - 07:59 AM"><p>
Hey mcremer,<br />
<br />
Thanks for taking time to read my post. Just to clarify, I didn't quote purposely. If you see, I added extra line in my second post "Also it would be great if there is column event adapter enhancement in BIRT.". I was trying to edit the 1st post and add this line but unfortunately it came up as second post.<br />
<br />
Coming to my question, based on the name of the column I want to hide/unhide column in the table.<br />
<br />
Thanks<br /></p></blockquote>
<br />
Hi Happy_20,<br />
<br />
I take it is per table (thats why how this script is going to work).<br />
<br />
On the create part of the column that will contain some script. I did this before ill post it later today. (Sorta bussy atm).
Happy_20
<blockquote class='ipsBlockquote' data-author="'mcremer'" data-cid="81573" data-time="1313486917" data-date="16 August 2011 - 02:28 AM"><p>
Hi Happy_20,<br />
<br />
I take it is per table (thats why how this script is going to work).<br />
<br />
On the create part of the column that will contain some script. I did this before ill post it later today. (Sorta bussy atm).<br /></p></blockquote>
I tried using TableEventAdapter. I could get access to columns but there is no property to set visibility to true or false for columns.
mcremer
<blockquote class='ipsBlockquote' data-author="'mcremer'" data-cid="81573" data-time="1313486917" data-date="16 August 2011 - 02:28 AM"><p>
Hi Happy_20,<br />
<br />
I take it is per table (thats why how this script is going to work).<br />
<br />
On the create part of the column that will contain some script. I did this before ill post it later today. (Sorta bussy atm).<br /></p></blockquote>
<br />
As promised here are the scripts:<br />
<br />
on the create of a data object you want to set the visabilety on you write:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var rowLast = BirtStr.trim(''+reportContext.getGlobalVariable("PRODUCT_rlp"));
var rowLastp = this.getRowData().getColumnValue("PRODUCT");
reportContext.setGlobalVariable("PRODUCT_rl", rowLast);
reportContext.setGlobalVariable("PRODUCT_rlp", rowLastp);
</pre>
<br />
Then on the Visebilety of the whole column you set the folowing code:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
if( row["PRODUCT"] == reportContext.getGlobalVariable("PRODUCT_rlp") ){
true;
}else{
false;
}
</pre>
<br />
Hope this helps.