简体   繁体   English

SQL Server 2008 R2 Reporting Services-获取订阅和计划链接

[英]SQL Server 2008 R2 Reporting Services - Get Subscription + Schedule Link

Using SQL Server 2008 R2, .NET 4, and C#, I'm having some trouble finding out how I can link a report schedule, and report subscriptions. 使用SQL Server 2008 R2,.NET 4,和C#中,我遇到了一些麻烦找出如何链接申报制度,并报告订阅。

I can get a list of all the reports, of all the subscriptions, and of all the schedules, that's fine and working. 我能得到的所有报告的所有订阅,列表,和所有的时间表,这是罚款和工作。 So I have my data in its rawest form, but when trying to find some way to get a list of all subscriptions that use ScheduleA, for example, I simply cannot find anything. 因此,我以原始格式存储了数据,但是,例如,当尝试寻找某种方式获取使用ScheduleA的所有订阅的列表时,我什么都找不到。

I've searched MSDN, spent the afternoon trawling Google, all to no avail. 我搜索了MSDN,花了整个下午拖拉Google,但都无济于事。 I'm hoping that it's not as difficult as it seems, because it really shouldn't be. 我希望它并不像看起来那样困难,因为它实际上不应该如此。

Thanks to the person who commented on my original question, that led me to having a method which accepted a schedule ID, and doing the following once I'd got the reports: 多亏了对我的原始问题发表评论的人,这使我有了一个接受计划ID的方法,并在获得报告后执行以下操作:

var subscriptions = service.ListSubscriptions(report.Path);

foreach (var subscription in subscriptions)
{
    ExtensionSettings settings;
    string description, status, eventType, matchData;
    ActiveState state;
    ParameterValue[] parameters;
    string user = service.GetSubscriptionProperties(subscription.SubscriptionID, out settings,
                                                    out description, out state, out status, out eventType,
                                                    out matchData, out parameters);
    if (matchData == scheduleId)
    {
        // Do what I need to do
    }
}

This ended up giving me the solution I was looking for. 最终给了我我想要的解决方案。 Now I'm on to a different problem, unfortunately, but I'll make a different question for that if I need to. 不幸的是,现在我面临一个不同的问题,但是如果需要的话,我将对此提出另一个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM