Reputation: 5
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
Reputation: 63729
Here's a suggestion to do this:
Encapsulate the query in a view or stored procedure.
Create a main report what does something like:
SELECT COUNT(*) FROM MyView WHERE myDate BETWEEN @startDate AND @Enddate
Show the First
result of your dataset (the count) in a textbox
Set an action to navigate to a subreport (see below) passing the same parameters
Create a subreport with a query like this:
SELECT * FROM MyView WHERE myDate BETWEEN @startDate AND @Enddate
Show a tablix with the data in the subreport.
Optionally include a link back to the main report, etc.
Upvotes: 1