Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show message "NO DATA FOUND" in SSRS report

I have created SSRS report having 3 columns in it. Now, I have to show "NO DATA FOUND" message below report header. How can I achieve it. I cant not use report property "NO ROW" as I have to show Report Header also.

Followings are the fields in my Report tabix:
ContentId,
Version
ApprovedBy

I have tried following to show "NO DATA FOUND" message:
In Tabix textbox, I have added expression:
=IIF(Count(Fields!ContentId.Value)=0 OR IsNothing(Fields!ContentId.Value)=true,"NO DATA FOUND.",NOTHING)

But, It is not working. Please suggest me, where I am doing wrong. Thanks

like image 651
Prashant Khadatkar Avatar asked Mar 03 '14 06:03

Prashant Khadatkar


People also ask

How do I display error messages in SSRS report?

Error log for SSRS reports: If the SQL Server Reporting Service (SSRS) generated an error message, you can view the error log for additional information. The error log is located in the \Reports\Errors\ userID subfolder, in the base installation directory on the server where TaskMan resides.

Which property is used to display a message when there is no data returned from a dataset used in Matrix?

You could set the property NoRowsMessage available on the report's table control like this: Select the Tablix control and press F4 to view the Properties pane. Find the NoRowsMessage property and set the value to whatever message you'd like. You can also to format the message using the Font and TextAlign properties.


2 Answers

You can do the following if using a table...since the table doesn't have the NoRowsMessage feature:

1. Add a text box with expression =IIF(Count(Some Field,"DataSet1")=0,"No Data Returned", nothing)

2. Then, set the visibility of this textbox as =IIF(Count(Some Field,"DataSet1")=0,False,True)

like image 55
BIReportGuy Avatar answered Nov 04 '22 04:11

BIReportGuy


The reason I imagine it is not working is you have this textbox in a data (non-header) row of the tablix. Since there is no data, this row will be repeated exactly zero times.

You should be able to do either of the following:

  • Add a header row to the table with the text "NO DATA FOUND" which is hidden on =Count(Fields!ContentId.Value) > 0.

  • Add a normal textbox outside of the tablix below the table, similar to the above. You may need to explicitly specify the data source. If it is hidden, the space should be consumed and the report will display as normal.

like image 1
lc. Avatar answered Nov 04 '22 03:11

lc.