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)
Visiblity expression to hide elements in detail row
slemaster
I have a requirement which I am having trouble figuring out. I have a report, lets say it is showing 100 rows. one of the columns is equipment id and it can repeat itself more than once.
What I want to do is if the equipment id is repeated i want to hide the first 5 columns and only show the data for the last 2 columns. So basically it is hiding duplicate information.
So do i need to set a variable somewhere to track the last equipment id and compare it to the current? Where would you initialize that variable and where would you reset it?
Find more posts tagged with
Comments
Davolio
<a class='bbc_url' href='
http://www.birt-exchange.org/forum/designing-birt-reports/12472-table-filtered-data.html'>http://www.birt-exchange.org/forum/designing-birt-reports/12472-table-filtered-data.html</a><br
/>
<br />
You could try something like that but tailor it to only show on the last two rows, it will probably be harder though to show on the last rows instead of the first rows because of the way datasets work. <br />
<br />
Another suggestion is to just use a crosstab depending on what it is you actually are doing. <br />
<br />
There is also column property if you click a table and click general, there is a suppress duplicates check box. You may just want to try that too. <br />
<br />
Hope some of that was useful,<br />
<br />
Dave
slemaster
Thanks for the info dave. I never seen a suppress duplicates button on the general tab or any other tab and i have worked with 3 different versions now. However that won't work anyway because i need to show data for a couple of the columns in the duplicate rows.
I need a way to retrive the previous row's value. Is there a way to get the previous row's value?
Davolio
I don't know of a slick way to do it, what I do when I need a previous row's value is store it in a variable...<br />
<br />
<br />
<br />
I had a column named ROLE.<br />
I put text boxes in my table and bound my dataset to the table. <br />
<br />
in the Oncreate method of the text box I put in code like this...<br />
<br />
What this code does is if the row value is the same as the previous value, set it to blank; else keep it the new value and set the current global variable to the new ROLE. <br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
this.text = this.getRowData().getColumnValue("ROLE");
if(this.text.equals(reportContext.getGlobalVariable("prevRole")))
{
this.text = "";
}
else
{
reportContext.setGlobalVariable("prevRole",this.text);
}
</pre>
slemaster
Thanks Dave,
I didn't need the whole solution but the first line of code helped me out. basically i initialized a variable at the top of the report in the header row.
Down in the detail row for each column i selected "Visibility", hide element and put in an expression like this:
if (row["eq_id"] == eqid) {
true;
} else {
false;
}
And inside the onCreate method on the last column I used this:
eqid = this.getRowData().getColumnValue("eq_id");
Worked like a charm. Thanks for the help.