简体   繁体   English

我想通过单击一个字段来执行报告订阅

[英]I want to execute a report subscription by clicking on a field

I have created a report on the SQL Server Report Service that lists all reports and their corresponding subscriptions. 我已经在SQL Server报告服务上创建了一个报告,其中列出了所有报告及其相应的订阅。

[report name] [subscription description] [run]

I have added a column called [run] that contains an image. 我添加了一个名为[run]的列,其中包含一个图像。 I want to make it so that if the user clicks on the [run] image/cell, it executes the corresponding subscription. 我要这样做,以便如果用户单击[run]图像/单元格,它将执行相应的订阅。

Is this possible? 这可能吗?

I've looked at the image action, but it only seems to allow execution of reports (not subscriptions) or URLs. 我看过图像操作,但它似乎只允许执行报告(不包括订阅)或URL。

The workaround I used was to create a separate report called SubscriptionRunner which accepts one parameter (the subscription id) and executes that subscription using the following SQL (provided by Anthony Forloney): 我使用的解决方法是创建一个名为SubscriptionRunner的单独报告,该报告接受一个参数(订阅ID)并使用以下SQL(由Anthony Forloney提供)执行该订阅:

EXEC ReportServer.dbo.AddEvent @EventType='TimedSubscription', @EventData=<SubscriptionID>

I then set the Action property of the cell in the original report to Run the SubscriptionRunner report. 然后,我将原始报告中单元的“操作”属性设置为“运行SubscriptionRunner”报告。

This has the side effect of opening SubscriptionRunner (which I would prefer to avoid) but it will do for now. 这具有打开SubscriptionRunner的副作用(我希望避免这种情况),但现在会这样做。

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

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