简体   繁体   English

具有灵活日期的SSRS报告订阅计划

[英]SSRS Report subscription scheduling with flexible dates

I have a set of reports that are being updated 4 times a month on set dates; 我有一套报告,在设定的日期每月更新4次; on 1,9,16 and 24th. 在1,9,16和24日。 When any of these dates occur on weekends the updating will be done the next monday. 当这些日期中的任何一个在周末发生时,更新将在下一个星期一完成。 Now I'm working on a schedule that will send emails to persons once the report has been updated, and the problem is those weekends. 现在我正在制定一个计划,一旦报告更新,就会向人们发送电子邮件,问题出在那些周末。 Can I somehow script the schedule to skip dates on weekends and do it on the next monday instead? 我可以以某种方式编制时间表,以便在周末跳过日期并在下一个星期一进行吗?

You can do this using a data-driven subscription. 您可以使用数据驱动的订阅来完成此操作。 You'll need to write a SQL query that checks the current day and determines if it's one of these cases or not. 您需要编写一个SQL查询来检查当前日期并确定它是否是这些情况之一。 Have the query return the email addresses you want to send to if it's a valid day. 如果查询是有效日,请让查询返回您要发送的电子邮件地址。

Then in the "To" field for the subscription you can reference the field from the query. 然后,在订阅的“收件人”字段中,您可以引用查询中的字段。 Set it to run every day. 将其设置为每天运行。 The subscription will run that query every day and deliver the email only when the conditions are true. 订阅将每天运行该查询,并仅在条件为真时发送电子邮件。

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

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