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)
How hidding row depending on nested table ?
Juwan
Hello everybody,
I try to hide a row if its nested table inside it is null or empty. I put a picture to help understanding, I try to hide the "Commune" row if the nested table "Code_commune" is empty.
If anybody has a suggestion ?
Thanks
Find more posts tagged with
Comments
kclark
Juwan,<br />
You can use the expression builder to hide tables and rows based on parameters.<br />
<br />
First I created x in my dataSet's before open to 0 because I used this as my counter.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
x = 0;
</pre>
<br />
Next I created a new parameter called hideTable and set it to boolean with a default value of true, in hideTable's onFetch I used the bellow code to count the data in row OFFICECODE<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
if (params["hideTable"] == true)
{
if (x < 4)
{
row["OFFICECODE"] = x;
x++;
return true;
}
}
return false;
</pre>
<br />
Next I dragged over hideTable to the correct row. Once this is done, I selected the row I wanted to hide, and selected the visibility tab under the properties editor. I checked the Hide Element checkbox and used the following expression to evaluate if the row was empty<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
rowsReturned = Total.count();
(Total.count() <0)
</pre>
<br />
After all of that we are almost done. I then set in the root of the report<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
rowsReturned = 0;
</pre>
<br />
And if you'd like you can put a label somewhere on the report that shows "No data returned". Create a label > selected the visibility tab > select hide element and use the following expression<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>(rowsReturned > 0)</pre>
<br />
When my report is ran it asks you for the office number, if you select a number that isn't in the list then that row is hidden otherwise it is displayed.
Juwan
Thanks for your answer but I am new with Birt and I don't understand what you're doing... Could you post a example .rptdesign ?
Thanks
Kaushik143
Hi Kclark,<br />
<br />
I have similar problem.<br />
Please help me out to run my birt report, This is the link <br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/org/forum/index.php/topic/29318-script-unable-to-run-in-preview-tab-or-in-html-but-runs-well-in-web-viewer/'>My
link</a><br />
<br />
<br />
Thanks and regards<br />
Kaushik