Much time, effort and money can be spent on providing reports to end users, so frustration can ensue when the intended audience doesn't bother to view the reports. Also, for security purposes it is a good practice to review who is looking at reports in SQL Server Reporting Services (SSRS) in case the user no longer has a need to know the information contained in the reports. How can we find out who has accessed SSRS reports? Check out this tip to learn more.
As in previous versions, SQL Server 2012 Reporting Services provides us with a number of tables and views to let us see who has accessed what report and when they accessed the report.
The T-SQL query below selects from the ExecutionLog2 view in the ReportServer database.
isnull(el2.Parameters, 'N/A') as Parameters
FROM ExecutionLog2 el2
The first 13 rows output from the T-SQL code are shown below. As you can see in this image, we can see who viewed which report, when they viewed the report, and which parameters if any were passed to the report. This query itself could be used within an SSRS report and then published to the report server.
Using a query similar to the one shown below, we can look at the TimeEnd column to determine when the reports are being viewed. This will help us gain insight into when our processes that are generating the data behind the reports should complete. We can also look at the results of this query to determine behavioral patterns of the report users.
SELECT username, convert(varchar(25),TimeEnd, 120) as AccessTime
ORDER BY AccessTime desc
The query shown below will return the report access counts per user and report for the current month.
SELECT username, ReportPath, count(*) as ViewCount
AND TimeEnd>=DATEADD(mm, DATEDIFF(mm, 0, GETDATE()), 0)
GROUP BY username, ReportPath
ORDER BY username, ViewCount desc
I have provided you with some basic queries to start understanding your user behaviors, change up the query to better meet your needs.