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)
Using addHideRule to dynamically hide columns in a table
deeebee
Hi,
I am trying to add hide rules dynamically to to columns in a table in the onPrepare method of the table but cannot work out how to create the HideRule.
Does anyone have an example of doing this?
The context is that my data contains columns which are empty, and need to be hidden in the table, but I have a lot of columns and I don't want to have to write the rule into every column as I set it up, I'd really like the table to right a simple rule into every column like row[colnumber] == undefined;
Any help gratefully received.
Richard
Find more posts tagged with
Comments
mcremer
<blockquote class='ipsBlockquote' data-author="'deeebee'" data-cid="81706" data-time="1313752415" data-date="19 August 2011 - 04:13 AM"><p>
Hi,<br />
<br />
I am trying to add hide rules dynamically to to columns in a table in the onPrepare method of the table but cannot work out how to create the HideRule. <br />
<br />
Does anyone have an example of doing this? <br />
<br />
The context is that my data contains columns which are empty, and need to be hidden in the table, but I have a lot of columns and I don't want to have to write the rule into every column as I set it up, I'd really like the table to right a simple rule into every column like row[colnumber] == undefined;<br />
<br />
Any help gratefully received.<br />
<br />
Richard<br /></p></blockquote>
<br />
I remeber somting in the DEV share about it somwere.<br />
<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/org/devshare/all-topics/filtercontent-hide/contenttype/timeperiod0/results100/pageno/sortby-/type/'>http://www.birt-exchange.org/org/devshare/all-topics/filtercontent-hide/contenttype/timeperiod0/results100/pageno/sortby-/type/</a><br
/>
<br />
found it:<br />
<br />
If you go to the on create event of a object you could set some ting like this:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var rowLast = BirtStr.trim(''+reportContext.getGlobalVariable("VAR1"));
var rowLastp = this.getRowData().getColumnValue("TABLE VALUE");
reportContext.setGlobalVariable("VAR1", rowLast);
reportContext.setGlobalVariable("VAR2", rowLastp);
</pre>
<br />
Then on the hide you can do somting like this:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>if( row["TABLE VALUE"] == reportContext.getGlobalVariable("VAR1") ){
true;
}else{
false;
}</pre>
mcremer
This is of course an example more complex examples you can vind in the DevShare
neerajk
I AM A NEW ACTUAE DEVELOPER SO PLEASE HELP ME!!!!!
now coming back to the issue...this is a simple sod file that I am modifying using e.SpreadSheet Designer...the report takes a user parameter of country values like USA, UK, IND
so the code is something like
if :country = 'usa'
select col1, col2, col 3 from table1 where :country = 'USA' ;
else if :country = 'UK
select col1,col3,col4, col4 from table 1 where :country = 'UK' ;
else....something like that
so when the xls report is generated for usa as parameter input by user
col1, col2, col 3
while it shows
col1,col3,col4, col4 for UK as parameter inputted by user
so the design of report may show
all columns but the columns get hidden or shown depending on the parameter.
Thanks,
Neeraj