ReportViewer: Displaying an empty row on a table

We use Microsoft’s ReportViewer for our reporting needs.  It isn’t the most elegant but it does the job.

Recently I needed to display a table on a report with an empty row if there was no data in the data source.  This is a visual indicator on the report that there is no data for that item.  Here are the instructions on the way that I found to do this.

1.  Right click on the data row in the table
2.  Add a new row below it, outside of the group.
3.  Right click on the row and select row visibility
4.  Click the radio button for “Show or hide based on expression”
5.  Enter code similar to the following as the expression:

=IIF(Sum(Fields!Id.Value, "DataSetName") > 0, true, false)

This will show the row empty if there is no data and hide it if there is data.  Not very elegant but will do the job.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s