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)
Hide a grid row if the table inside this row is empty
JohannJ
<p>HI Everyone,</p>
<p> </p>
<p>I am using Eclipse Mars.1 Release (4.5.1) and BIRT 4.5.0.</p>
<p> </p>
<p>My report has a grid with some rows. Each grid row contains a table. To set the Visibility of a table I use an Aggregation. If the table is empty the table is not visible.</p>
<p> </p>
<p>But how can I hide the grid row, if the table inside this row is empty ?</p>
<p> </p>
<p>Thanks in advance.</p>
<p>Johann</p>
Find more posts tagged with
Comments
icirillo
<p>Hi <span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">Johann,</span></p>
<p> </p>
<p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">please look at the following solution:</span></p>
<p> </p>
<p><a data-ipb='nomediaparse' href='
https://www.eclipse.org/forums/index.php/t/218294/'>https://www.eclipse.org/forums/index.php/t/218294/</a></p>
;
<p> </p>
<p>It should also work for grids if you create the count aggregation in the column bindings of the grid instead of in the column bindings of the table.</p>
JohannJ
<p>Hi Ivano<br><br>
thanks for your reply, but it doesn't work in my case.<br><br>
Look at the adapted example (norowsWithGrid.rptdesign).<br><br>
In this example there is a grid "GridChapter" with no data set and two rows.<br>
In every grid row there is a table "Table1" and "Table2" with a column binding "MyRowCount". If a table is empty the table is not visible, but the grid row is still visible.<br>
I don't know how the column binding for the grid rows should look like in a grid with no data set.<br>
Do you have any idea ?<br><br>
Thanks in advance.<br><br>
Johann</p>
pricher
<p>Hi Johann,</p>
<p> </p>
<p>Because the grid is created before the tables, you cannot control the grid visibility based on an aggregation at the table level. You need to bind your data set to the grid, create an aggregate at that level, and use that aggregate to control the visibility of a grid row.</p>
<p> </p>
<p>In the attached example, the first row of the grid will not be displayed when the data set returns nothing.</p>
<p> </p>
<p>Hope this helps,</p>
<p> </p>
<p>P.</p>
JohannJ
<p>Hi Pierre<br><br>
thanks for your help.<br>
You are right, it couldn't work.</p>
<p>
In your example the grid and the table inside this grid uses the same data set, so I think it only works if the grid and all the tables inside the grid uses the same data set / database table.<br><br>
In my case the report contains several chapters. Each chapter contains one grid with several tables with different data sets / database tables. The reason why I use grids is to easy switch the visibility of each chapter (grid) in my report.<br><br>
I think I have to change my report design.</p>
<p> </p>
<p>Thanks</p>
<p>Johann</p>
icirillo
<p>I Johann,</p>
<p> </p>
<p>with the attached example it works as you wish but it is needed to duplicate the tables. Why we need to duplicate the tables is because if you don't put a hidden table at the beginning of the report then the datasets will not load the data before the grid is rendered but after the grid is rendered then the "count variables" defined in the initialize method of the report will be equal to zero and will not be useful to hide the grid lines. I don't think there is a better solution also according to the following thread:</p>
<p> </p>
<p><a data-ipb='nomediaparse' href='
https://www.eclipse.org/forums/index.php/t/240097/'>https://www.eclipse.org/forums/index.php/t/240097/</a></p>
;
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
JohannJ
<p>Hi</p>
<p> </p>
<p><span>Perfect, it works.</span></p>
<p><span>Thank you very much for your help</span></p>
<p> </p>
<p>Thanks</p>
<p>Johann</p>