简体   繁体   English

SSRS数据驱动的订阅[基于静态订阅表]不接收对订阅表所做的更改

[英]SSRS Data-Driven Subscription [based on static Subscription table] Not Picking Up Changes Made to Subscription Table

I have a .RDL report which I designed in BIDS and have deployed to my report server. 我有一个在BIDS中设计的.RDL报告,并已部署到我的报告服务器中。 The report asks for three parameters before viewing report: Year , Month and Customer ID . 该报告在查看报告之前会要求三个参数: YearMonthCustomer ID The report works great and does exactly what it is supposed to. 该报告效果很好,并且完全可以完成预期的工作。

While I used to run each report individually because there were 2-3 customers, now there are 30+ customers who receive the report, so I wanted to switch to a more automated fulfillment method to get the reports generated. 由于过去有2-3个客户,我以前分别运行每个报表,但是现在有30多个客户接收该报表,因此我想切换到一种更自动化的实现方法来生成报表。 After doing some research it appears that a using Report Manager to create a "Data Driven Subscription" (DDS) using the "Windows File Share" option gives me the capabilities I need. 经过研究后,使用“ Windows文件共享”选项使用报表管理器创建“数据驱动订阅”(DDS)似乎给了我所需的功能。

As part of creating the DDS, I created a table called [Subscription] which is a table containing one row for each customer receiving the report and has the following columns: 在创建DDS的过程中,我创建了一个名为[Subscription]的表,该表为接收报告的每个客户包含一行,并具有以下几列:

  • Year
  • Month
  • CustomerID 顾客ID
  • FileName 文档名称
  • FileLocation 文件位置
  • Overwrite 覆盖
  • Format 格式

...so through using the DDS Wizard in Report Manager, I was able to successfully set up a Data Driven Subscription (which is linked to various columns in the [Subscription] table) which creates a new report for each customer in the [Subscription] table, saves [and overwrites, if necessary] it in a location of my choosing as a PDF (specified in [Subscription].[FileLocation] , or the FileLocation column of my table for each row), and runs every minute (I plan on changing frequency to once a week, eventually). ...所以通过在报表管理器使用DDS向导,我是能够成功地建立了一个数据驱动的订阅(链接到各列的[Subscription]这会在每个客户的一份新报告表) [Subscription]表,将其保存(并覆盖,如果需要的话)为我选择的PDF格式的位置(在[Subscription].[FileLocation]或表的FileLocation列中为每一行指定),并每分钟运行一次(我最终将频率更改为每周一次)。

This works flawlessly, giving me a new set of 30 reports in the directory of my choosing, with each report having a name I assigned in the FileName column of my table. 这项工作完美无缺,在我选择的目录中为我提供了一组新的30个报告,每个报告都有我在表的FileName列中分配的名称。 Exactly what I was looking for. 正是我想要的。

HERE'S THE PROBLEM: When I update the FileLocation or FileName (or anything, really) in the [Subscription] table - it doesn't pick up the changes right away. 这里的问题是:当我更新[Subscription]表中的FileLocationFileName (或其他任何东西)时,它不会立即进行更改。 Sometimes it doesn't even pick it up at all (for example I updated the [ReportName] column for one customer from Report_711622 to SpecialReport_711622 , so that the output file for that customer should be named SpecialReport_711622 while all of the other reports should be called Report_XXXXX [no Special prefix]. But the file name of report for Customer 711622 remains the same! 有时甚至根本无法使用它(例如,我将一个客户[ReportName]列从Report_711622SpecialReport_711622 ,以便该客户的输出文件应命名为SpecialReport_711622而应调用所有其他报告Report_XXXXX [无Special前缀], 但客户711622的报告文件名保持不变!

It's almost like the job only see's what it needs to do once a day, and then does not go back and reference the [Subscription] table until I leave for the night, then when I come back in the morning it picks up the change. 几乎就像工作只看到每天需要做的事情,然后直到我晚上离开时才返回并引用[Subscription]表,然后当我早晨回来时便找了零钱。

Since I am about to scale this process out to a large customer-base using a different report, I need to be able to make edits to the [Subscription] table and have them get picked up by the Data Driven Subscription immediately (and if not immediately, at least a fixed interval of time that I can adjust, so that I can know 100% when the change will get picked up). 由于我将使用不同的报告将这一过程扩展到庞大的客户群,因此我需要能够对[Subscription]表进行编辑,并让它们立即被“数据驱动订阅”获取(如果没有,立即,至少可以调整一个固定的时间间隔,以便我可以100%知道何时获得更改。)

Does anyone know what's causing my lag? 有人知道是什么原因导致我的延迟吗? How do I change it so that updates to the Subscription table get picked up regularly? 如何更改它,以便定期获取对Subscription表的更新? I'm also having issues with creating new DDS on other reports (following the exact process outlined above) - I've created the subscriptions, for every minute, and it says they are running and the number of outputs match the number of customers with 0 errors, but there are no files in the drive I specified (or anywhere else I've looked, for that matter). 我在其他报表上创建新的DDS时也遇到了问题(遵循上面概述的确切过程)-我已经创建了每分钟的订阅,并且说订阅正在运行,并且输出数量与客户数量相匹配。错误为0,但我指定的驱动器(或与此相关的其他地方)中没有文件。

Any help would be greatly appreciated! 任何帮助将不胜感激!

I think the answer lies in the mechanism SSRS uses. 我认为答案在于SSRS使用的机制。 There are a few places "lag" can occur. 有几个地方可能会出现“滞后”。

The subscription is in fact an SQL Agent job which creates a record in the Event table. 预订实际上是一个SQL Agent作业,可在事件表中创建一条记录。 This table is a queue that SSRS checks to do scheduled tasks. 该表是SSRS检查执行预定任务的队列。

There is a small amount of time between the moment the subscription creates the Event record and the moment SQL reads it and starts creating the dataset for your DDS. 从订阅创建事件记录到SQL读取事件记录并开始为DDS创建数据集之间,只有一小段时间。 The creation of the DDS dataset takes some time, too. DDS数据集的创建也需要一些时间。 In this time, the subscription will be in the Pending state. 此时,订阅将处于“待处理”状态。 If you change anything in the data during this time, The subscription will still use the old data as report parameters. 如果您在此期间更改数据中的任何内容,则订阅仍将使用旧数据作为报告参数。 So obviously you will not notice your change until the next scheduled run. 因此,很明显,您不会在下一次计划运行之前注意到您的更改。

Which brings me to the following: if a subscription is still being run and the next schedule kicks in (chances are, because yours runs every minute), the engine will not execute it, but wait for the next subscription schedule, and so on. 这使我想到以下内容:如果订阅仍在运行,并且下一个计划开始执行(可能是因为您的运行时间是每分钟),引擎将不会执行它,而是等待下一个订阅计划,依此类推。 So that's another possibility of lag - and cause of missing reports for a certain schedule minute. 因此,这是另一种滞后的可能性-并导致在特定的计划分钟内丢失报告。 The subscription processes reports sequentially, one row from your DDS recordset at a time. 订阅顺序处理报告,一次从DDS记录集中一行。 Again, this takes some time. 同样,这需要一些时间。 You can also see that in the subscription window when it says: # of # processed. 您还可以在订阅窗口中看到以下内容:已处理的#个。

I suggest you look at the Event table in the database ReportServer during an execution. 我建议您在执行过程中查看数据库ReportServer中的事件表。 Also the ExecutionHistory views (there are 3) may be interesting. 另外,ExecutionHistory视图(有3个)可能很有趣。 A scheduled run shows up as a RequestType = 1 and generates one record for each report. 计划的运行显示为RequestType = 1,并为每个报告生成一个记录。 You can see the exact timing and parameters of each report that is run in the subscription. 您可以查看订阅中运行的每个报告的确切时间和参数。 You may be able to extract the data you need to resolve your other issues. 您也许可以提取解决其他问题所需的数据。

EDIT: Here is a more elaborate guide to DDS data and events http://blogs.msdn.com/b/deanka/archive/2009/01/13/diagnosing-and-troubleshooting-subscriptions.aspx http://blogs.msdn.com/b/deanka/archive/2010/02/16/troubleshooting-subscriptions-part-ii-using-the-report-services-trace-log-file.aspx 编辑:这是DDS数据和事件的更详尽指南, http: //blogs.msdn.com/b/deanka/archive/2009/01/13/diagnosing-and-troubleshooting-subscriptions.aspx http:// blogs。 msdn.com/b/deanka/archive/2010/02/16/troubleshooting-subscriptions-part-ii-using-the-report-services-trace-log-file.aspx

Could this "Double-Hop" problem be the source of my issues? 这个“双跳”问题会成为我问题的根源吗? I'm so stuck on this one! 我被这个卡住了! The Double-Hop Problem - MSDN Knowledgecast 双跳问题-MSDN Knowledgecast

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

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