?
Solved

Reporting Services: How to know if the report is empty

Posted on 2008-10-20
12
Medium Priority
?
692 Views
Last Modified: 2013-12-17
I am working on a web application which shows reports builts from Reporting Services. To show the report on the page I use a Report Viewer. I would like to know if there is a way to check whether the report has data before showing up the report.
0
Comment
Question by:karakav
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
12 Comments
 
LVL 12

Expert Comment

by:jgv
ID: 22760651
There's no method you can use through SSRS to check for this condition. You would have to independently run the same query that the report uses to see if there are any records. If you are asking because you want to show an appropriate message to the user in this situation there is a property for this. If you are using a List or Table object, look for the "NoRows" property. You can fill in a message that you want displayed on the report when no data is returned (ie: "No data was found matching your input")
0
 
LVL 4

Author Comment

by:karakav
ID: 22766260
What do you mean by "Using a List or Table"? Because me I directly show the report in a Report Viewer control.
0
 
LVL 12

Expert Comment

by:jgv
ID: 22766465
To set the NoRows property you have to edit the report in the report designer. This property should be available on the main object used to show the data (a Table, List, Matrix, etc). Did you build the report yourself or is this a report someone else built?
0
Understanding Linux Permissions

Linux for beginners: How to view the permissions associated with files and directories and also how you can change them.

 
LVL 4

Author Comment

by:karakav
ID: 22766663
I did it myself. The problem is that I don't manage to format that message so that I resemble the messages shown in the application.
0
 
LVL 12

Expert Comment

by:jgv
ID: 22767499
I'm not really sure what you mean by that last comment. Does the NoRows message shown in the report have to match something that is shown in your application (ie: the message can change each time the report is run?)

If you want to be able to set the NoRows message from your application you could create a "dummy" parameter that is set to Hidden and allows blank values. Pass a message into this parameter that will be shown if there is no data. The expression for the NoRows property would be something like this:
=Parameters!MessageToShowIfNoData.Value
0
 
LVL 4

Author Comment

by:karakav
ID: 22768378
My concern about the format is: For instance in the whole application, if a gridview doesn't contains data, I show a label with no data message. That label has same format: read font with special character. My problem is that inside the report designer, I can only define the no data message, but I can't define how that message will look like.
0
 
LVL 12

Accepted Solution

by:
jgv earned 2000 total points
ID: 22768707
Ok. Assuming that you are using a table, try this instead.

Add a Table Header and merge the cells
Enter a "no rows" message and format it the way you want.
Select the row and enter this in the Hidden property (replace the field name and dataset name)
=IIF(Count(Fields!AFieldInYourDataset.Value,"YourDataSetName")=0,False,True)
0
 
LVL 4

Author Comment

by:karakav
ID: 22768983
And what do I do mi mu current table header?
0
 
LVL 12

Expert Comment

by:jgv
ID: 22769057
You can have more than 1 table header. Right click the table header row and select "Insert Row Above"
0
 
LVL 4

Author Comment

by:karakav
ID: 22769216
Yeah, I saw. The problem is that my columns are dynamic and I don't in advance which columns will be displayed.
0
 
LVL 12

Expert Comment

by:jgv
ID: 22769477
Your choices are pretty limited. You could place another table on the report just above your existing table. Only include the table header row with the message but set the Hidden property on the table itself.
0
 
LVL 4

Author Closing Comment

by:karakav
ID: 31507911
OK. I will try it. Thanks very much for you help. It was very much appreciated.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question