1

I'm new to Reporting Services and using SQL Server Data Tools (Visual Studio 2012). I want to add an item that will display a single value - in this case, the result of a stored procedure call. The value would probably be displayed in the report header.

I've looked at the Tablix data parts that can be added to the report: table, list, and matrix. Not sure which of them, if any, would be appropriate. I could add a parameter item, but it seems that these function as user input choices.

I also looked at a read-only text box, but don't see how to populate it with a query result.

What is the accepted method of adding a single-value result to a report?

1 Answer 1

1

If this is to be displayed in the page header, your only option is a textbox; you can't add tablix type parts to page headers/footers.

The textbox expression would be something like:

=First(Fields!MyValue.Value, "DataSet1")

By using an aggregate expression like this you can make sure only one value is returned (even though you might always have only one) and you can also specify the aggregate's Scope; in this case the DataSet you want to query.

If this was going in the report body I would still recommend the same approach, though I wouldn't go so far as to call it best practise, any would work so it's really personal taste.

However, if you had multiple fields returned by the SP but still only one row, in that case I would recommend a table style tablix with one header-level row; easiest to maintain and layout.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.