1

我正在使用 SSRS 2016,并且有许多用户需要在上午 11 点之前收到与用户当地时间相关的电子邮件报告。

这样做的最佳做法是什么?

我最初的想法是为每个时区创建不同的 Active Directory 分发列表并相应地添加用户......然后为每个报告创建多个计划并调整报告发送时间相对于报告需要分发的时间列表。

例如,SQL 服务器处于中部时间,而东部和中部时间的员工需要在当地时间上午 11 点之前提交报告。- 创建电子邮件时间表,以便在上午 10 点(服务器时间)向东部时间员工发送报告,并在上午 11 点再次向中部时间员工发送报告。

有一个更好的方法吗?

4

1 回答 1

0

Your approach is exactly what we are doing. The SQL Server instance is in the Central time zone, and we have users around the world. Each group maintains a mailing list, and manually does arithmetic when creating a report subscription. Interestingly enough, SSRS adjusts to local user's language (Le rapport hebdomadaire @ReportName a été exécuté à @ExecutionTime instead of @ReportName was executed at @ExecutionTime for the default subject), but offers nothing to help with time zones.

If you have an enterprise edition of SQL Server, you could use data driven report subscriptions. Given the big increase in cost between standard and enterprise editions, I doubt this one feature justifies the cost.

The other solution requires things outside of SSRS, but it can be handy. If you have other scheduling tools running in the various locations, they could run a PowerShell script to trigger the subscription. You could also use this approach to run reports when data is loaded, for example.

PowerShell script to list subscriptions and their IDs:

$server = 'http://server.company.com/reportserver'
$site = '/'

$rs2010 = New-WebServiceProxy -Uri "$server/ReportService2010.asmx" -Namespace SSRS.ReportingService2010 -UseDefaultCredential
$subscriptions = $rs2010.ListSubscriptions($site)
$subscriptions | Sort-Object -property path,owner,SubscriptionID -Unique | select Path, Owner, SubscriptionID 

Powershell script to trigger subscription:

# Given an SSRS URL and a subscription ID, trigger the subscription.
$server = 'http://server.company.com/reportserver'
$subscriptionid = "55477447-b0b0-433c-a75f-08ad0b6d18bd"

$rs2010 = New-WebServiceProxy -Uri "$server/ReportService2010.asmx" -Namespace SSRS.ReportingService2010 -UseDefaultCredential ;
$rs2010.FireEvent("TimedSubscription",$subscriptionid,$null)
于 2017-04-05T16:17:55.720 回答