SSRS – Create a No Data Returned Textbox

When the dataset returns no rows, a bit of U.I. certainly goes a long way to avoid any confusion for the user running your report.

Create a textbox somewhere convenient on the page, and enter this in the expression for your textbox, substituting in your real dataset and field name. 


=IIF(Count(Fields!DatasetFieldName.Value, "your_dataset") = 0, "No Data Returned", Nothing)

…then enter this in the Hidden property expression for the same textbox.


=IIF(Count(Fields!DataSetFieldName.Value, "your_dataset") = 0, False, True)

 

 

2 thoughts on “SSRS – Create a No Data Returned Textbox”

    1. Shauno, this is true, a few reasons why I’ll use the old approach : 1) customers on ssrs 2005 2) you can do something cool, like display an image of a chicken instead of a message. 3) I can publish my no rows image or textbox as a reporting services part giving more freedom to place the message throughout the report. However that said the No Rows is a good approach.

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 )

Google+ photo

You are commenting using your Google+ 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 )

w

Connecting to %s