SSRS report Subscription History - reporting-services

I wanted the count of number of subscriptions of a report , Did a lot of research but unable to get the detail.
I did used Catalog and Execution log table , which just gives number of times report got executed but not the history of count of subscription with different parameters , Request any to provide any hint to acheive the task

ExecutionLog will return one record for every time a report was executed that is available based on your history retention.
What your looking for is the Subscription table.
SELECT
*
FROM
dbo.Catalog AS CAT
JOIN dbo.Subscriptions AS SUB
ON CAT.ItemID = SUB.Report_OID
WHERE
CAT.[Name] = 'My Report Name';

Related

multi parameter data subscription in ssrs only working with one value

I've started using SSRS for 6 month and trying to setup a data driven report where the parameter in the report may contain multiple values (customer numbers).
Ive tried to follow the guideline from microsoft:
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/3b0f1620-a7ac-4edd-a577-4beef4bddb14/forum-faq-how-to-configure-a-data-driven-subscription-which-get-multivalue-parameters-from-one?forum=sqlreportingservices#3b0f1620-a7ac-4edd-a577-4beef4bddb14
The parameter in the report is setup following the guideline:
uncheck “Allow multiple values” option for the parameter
check "none" on available values
check "none" on default values
The dataset properties for the parameter are setup by adding a filter:
CustomerKey in split(Parameters!Customer.Value, ",")
The report is working fine when there is only one customer in the subscription table but report is empty when the number of customer are more than one.
The data set of the report is not changed. The query of the data subscription is retrieving the data from the SQL table where I have stored the emails and customer number are related. The data tables looks like this:
The tabel is formatted in this way:
The query in the subscription using the table looks like this:
SELECT *
FROM [Table_Archive].[dbo].[ReportSubscription]
where ReportName='CustomerOrder' and Schedule='Every day'
The data retreived to be used in the report is defined by the following query:
select
CustomerLabel AS CustomerLabel
, CustomerKey AS CustomerKey
, SalesItemKey AS SalesItemKey
, SalesItemName AS SalesItemName
, SalesOrderDetailNumberKey
From factview.SalesOrder
where CustomerKey in (#Customer)
I've tried multiple solution on how to specify the customer number in the table (',';"," etc) but without success. I'm quite uncertain if the approach that i'm trying will ever work and i'm having difficulties in finding any good suggestions, hence this post.

How to find the last time a particular report was run

I'm using SSRS 2016. I want to find out the last time a particular report was run. Is this something I can easily query on the ReportServer database?
Thanks!
You can get this from the executionlog tables/views in the ReportServer database. By default this will have (I think) 60 days of logs. You can change this value in the ReportServer properties. I have 400 days retention so I can report on report usage.
Anyway, you can use something like this...
USE ReportServer
GO
select TOP 1
c.*
, el.*
from ExecutionLog el
join Catalog c on el.ReportID = c.ItemID
WHERE
c.[Path] = '/MyReportFolder/MyReportSubFolder'
and c.[Name] = 'MyReportName'
ORDER BY TimeStart DESC
The path =... is optional if all your report names are unique and the top 1 is there because you asked to only find the last time the report was run but you can obviously remove these limitations.

Can I get and display the Cache Last Run Date in a SSRS Report?

Is there a way to get the last run date from the cache refresh page for a SSRS report and have that displayed on the report? I'd like the user to know when the data was last refreshed.
You can query the ReportServer database directly to accomplish this:
SELECT MAX(els.TimeEnd) AS LastCacheRefresh
FROM dbo.ExecutionLogStorage AS els
INNER JOIN dbo.Catalog AS cat ON els.ReportID = cat.ItemID
WHERE els.RequestType = 2 --Refresh Cache
AND els.Status = 'rsSuccess'
AND cat.Name = 'MyReport'
Also FYI, Microsoft does not support querying the ReportServer database directly, which means fields/schema could change in later versions of SSRS.
Sorry to contribute to old thread, but wasn't finding a lot of hits on this question, so figured I'd add this:
If you include a calculated field in your source query, it is evaluated when the query is run and records along with the rest of your data. For example:
select
field1
, getdate() as QueryDateTime
from
SQLServerTable
and you can then use that value as min/max/first in your report (by definition is the same on every record).
This has to be done by the server dishing up the data, not as a calculated field in SSRS, because those are evaluated at run time, same as now() expression, or global execution time variable.
One downside of course is that you're recording that data and storing it, then having to retrieve a bunch of redundant data when pulling it, so it's not really efficient from a purist I/O perspective. I suspect the cost of one column of a single date value is not too much to worry about in most cases.

Ms Access change criteria of query using either a form or a report

Hey I'm working on a database in access. Is there anyway in access I can be able to change the criteria for a query using either a report or a form so that the result set changes every time I change the criteria but the query remains the same e.g.
SELECT customer FROM customers WHERE id = 2 this would be the query and the criteria is 2 I want to be able to change the id every time to get a different result set either via a report or a form or any other way other than the query itself
You can refer to a form in a query:
SELECT customer FROM customers WHERE id = Forms!MyForm!txtID
You can open a report using a WHERE statement.

Reporting Services report logs report destination

We have SSRS 2008 and have a heap of data driven subscriptions.
We've been tasked with creating a map of all the reports every user receives.
The query:
SELECT * FROM ReportServer.dbo.ExecutionLog2
gives us almost the information we want.
For what we want, it lacks the destination of the report.
Is there a way of finding out where a report was emailed?
My alternative I guess is to look at analysing the Exchange logs.
Is that a reasonable alternative?
You could get the destination of the data driven subscription from columns Parameters and DataSettings in the table Subscription from report server database.
The 2 columns record as xml format , you could get the node in column Parameters and get the node in column DataSettings. Then you could get correspond receiver for subscription.