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 can i hide a grid based on table visibility
Amit Kosta
Hello All,
Here is Amit. I want to know that how can i hide the grid based on table visibility.
Here i have two table and if both tables does not have any data than i need to hide the grid.
if one table have data and another not than i need to show it.
please find the report and resultant screenshot
Thankx in Advanced
Find more posts tagged with
Comments
kclark
You would create two variables in your reports onPrepare(), one for each table. You could the increment them in each tables onCreate() This will count how many rows you have. After you've done that you can set each tables visibility to false in the property editor and use an expression like if(table1Count > 0)<br />
<br />
Report onPrepare()<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var table1Count = 0;
var table2Count = 0;
</pre>
<br />
Table 1 onCreate()<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
table1Count++;
</pre>
<br />
Table 2 onCreate()<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
table2Count++;
</pre>
<br />
Expression for table 1<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
if(table1Count > 0)
</pre>
<br />
Expression for table 2<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
if(table2Count > 0)
</pre>