How to hide table in report (RDLC) if there is no data in the table?

hide table in rdlc report

Hide of blank table in report is essential in report design. Display of blank table in report is meaningless, confusing to the user as well it destroy the beauty of the report so it is always better idea to remove the blank table form the report.
During designing of report this should be kept in mind how the report looks like if there is no data on the table also how the report looks like if there is huge amount of data , how to handle the data in the report.

There are different ways to hide the blank table in RDLC report but among them I found Countrows method easiest and universal.

To hide the table in report if there is no data in table follow the following step:

1. Select and right click on the table then select Tablix Properties.
select tablix property

2. In the Tablix Properties window select Visibility from left column.
3. On right column select show or hide based on expression checkbox and click the function.
show or hide based on expression

4. On the expression window write the following code:
IIF(CountRows()>0,false,true)

code to hide blank table

5. Click ok on expression window as well in Tablix Properties window.
6. Save the report.

Reference:
More about countrows function
Hiding blank table on RDLC report

Feel Free to Share :

You May Also Like

About the Author: Abinash

Abinash Phuel

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.