Doreen
Doreen

Reputation: 736

SSRS how to display parameter in heading when no rows are returned

I am using Visual Studio 2008 to build a base report that has 3 parameters representing different types of services for which I am displaying all the companies and their details that match those parameters in a tablix under each Textbox heading.

The problem is that I am displaying the value of selected parameter in each heading using the expression:

="SERVICE1: " & First(Fields!Service1.Value, "dsServices")

When the DataSet resultset returns no rows, the parameter part of the heading is empty but when row are returned, the heading is as I want it (ex: "SERVICE1: Some sub service category here"). I want the full heading to show up even if there are no rows to display. How do I retain all of the heading? for the record I am using NoRowsMessage property when I want the tablix to be hidden due to no rows returned. Again, I still want the headings with the values selected to appear.

I googled to no avail. Thank you for any tip you can suggest.

Upvotes: 0

Views: 523

Answers (1)

Kalim
Kalim

Reputation: 485

The reason why your heading is empty, when your dataset returns nothing is because in your expression you are referencing the first record in your "dsServices" dataset.

This is what your expression does : ="SERVICE1: " & First(Fields!Service1.Value, "dsServices")

In your question you mention you have 3 parameters...if you want to reference these parameters then rather include the parameter value in the expression. That expression would like something like this:

="SERVICE1: " & Parameters!Service1.Value)

I'm obviously assuming you have a parameter for each service type. If you do this then your expression no longer becomes dependent on your dataset.

Upvotes: 2

Related Questions