user2703428
user2703428

Reputation: 5

how to display total records found in ssrs before view the report

I have created a report that returns results based on my date parameters @startDate and @Enddate. I want to be able to get a result that shows the totals number of records found before actually viewing the report. How do I add a count function to count totals records found. then add a hyperlink action to open the report?

Upvotes: 0

Views: 162

Answers (1)

Jeroen
Jeroen

Reputation: 63729

Here's a suggestion to do this:

  1. Encapsulate the query in a view or stored procedure.

  2. Create a main report what does something like:

    SELECT COUNT(*) FROM MyView WHERE myDate BETWEEN @startDate AND @Enddate

  3. Show the First result of your dataset (the count) in a textbox

  4. Set an action to navigate to a subreport (see below) passing the same parameters

  5. Create a subreport with a query like this:

    SELECT * FROM MyView WHERE myDate BETWEEN @startDate AND @Enddate

  6. Show a tablix with the data in the subreport.

Optionally include a link back to the main report, etc.

Upvotes: 1

Related Questions